• 大小: 661KB
    文件类型: .rar
    金币: 2
    下载: 1 次
    发布日期: 2021-05-22
  • 语言: C#
  • 标签: c#  悬浮窗口  可拖动  

资源简介

c# 悬浮窗口 带提示框提示 可拖动 类似于迅雷

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormsApplication2
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        //#############拖动窗体#############
        private bool isMouseDown = false;
        private Point FormLocation;     //form的location
        private Point mouseOffset;      //鼠标的按下位置

        //#############################
        private void button1_Click(object sender EventArgs e)
        {
            this.Close();
        }

        private void button1_MouseMove(object sender MouseEventArgs e)
        {
         
        }

        private void Form1_Load(object sender EventArgs e)
        {
            this.toolTip1.Active = true;
            this.toolTip1.AutomaticDelay = 1000;
            this.toolTip1.AutoPopDelay = 20000;
            this.toolTip1.InitialDelay = 100;
            this.toolTip1.ReshowDelay = 100; 
            this.toolTip1.BackColor = Color.LightYellow;
            this.toolTip1.ForeColor = Color.Salmon;
            this.toolTip1.IsBalloon = true;
            this.toolTip1.ShowAlways = false; 
            this.toolTip1.StripAmpersands = false;
            this.toolTip1.ToolTipIcon = ToolTipIcon.Info;   
            this.toolTip1.ToolTiptitle = “温馨提示“;
            this.toolTip1.UseAnimation = true; 
            this.toolTip1.UseFading = true; 
            this.toolTip1.SetToolTip(this.button1 “   退出程序“);
            this.toolTip1.SetToolTip(this.button2 “   英文听写“);
        }

        private void button2_Click(object sender EventArgs e)
        {
           
        }

        private void button2_MouseDown(object sender MouseEventArgs e)
        {
           
        }

        private void Form1_MouseDown(object sender MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Left)
            {
                isMouseDown = true;
                FormLocation = this.Location;
                mouseOffset = Control.MousePosition;
            }

        }

        private void Form1_MouseUp(object sender MouseEventArgs e)
        {
            isMouseDown = false;

        }

        private void Form1_MouseMove(object sender MouseEventArgs e)
        {
            int _x = 0;
            int _y = 0;
            if (isMouseDown)
            {
                Point pt = Control.MousePosition;
                _x = mouseOffset.X - pt.X;
                _y = mouseOffset.Y - pt.Y;

                this.Location = new Point(FormLocation.X - _x FormLocation.Y - _y);
            }

        }
    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件     172032  2011-06-04 11:43  WindowsFormsApplication2\WindowsFormsApplication2\bin\Debug\WindowsFormsApplication2.exe

     文件      26112  2011-06-04 11:43  WindowsFormsApplication2\WindowsFormsApplication2\bin\Debug\WindowsFormsApplication2.pdb

     文件      11600  2011-06-04 11:10  WindowsFormsApplication2\WindowsFormsApplication2\bin\Debug\WindowsFormsApplication2.vshost.exe

     文件        490  2010-03-17 22:39  WindowsFormsApplication2\WindowsFormsApplication2\bin\Debug\WindowsFormsApplication2.vshost.exe.manifest

     文件       2877  2011-06-04 11:46  WindowsFormsApplication2\WindowsFormsApplication2\Form1.cs

     文件       5193  2011-06-04 11:46  WindowsFormsApplication2\WindowsFormsApplication2\Form1.Designer.cs

     文件     246750  2011-06-04 11:46  WindowsFormsApplication2\WindowsFormsApplication2\Form1.resx

     文件       2152  2011-06-04 10:25  WindowsFormsApplication2\WindowsFormsApplication2\obj\x86\Debug\DesignTimeResolveAssemblyReferences.cache

     文件       6265  2011-06-04 11:43  WindowsFormsApplication2\WindowsFormsApplication2\obj\x86\Debug\DesignTimeResolveAssemblyReferencesInput.cache

     文件        512  2011-06-04 11:43  WindowsFormsApplication2\WindowsFormsApplication2\obj\x86\Debug\GenerateResource.read.1.tlog

     文件       1920  2011-06-04 11:43  WindowsFormsApplication2\WindowsFormsApplication2\obj\x86\Debug\GenerateResource.write.1.tlog

     文件        934  2011-06-04 11:30  WindowsFormsApplication2\WindowsFormsApplication2\obj\x86\Debug\WindowsFormsApplication2.csproj.FileListAbsolute.txt

     文件     172032  2011-06-04 11:43  WindowsFormsApplication2\WindowsFormsApplication2\obj\x86\Debug\WindowsFormsApplication2.exe

     文件     160972  2011-06-04 11:43  WindowsFormsApplication2\WindowsFormsApplication2\obj\x86\Debug\WindowsFormsApplication2.Form1.resources

     文件      26112  2011-06-04 11:43  WindowsFormsApplication2\WindowsFormsApplication2\obj\x86\Debug\WindowsFormsApplication2.pdb

     文件        180  2011-06-04 11:15  WindowsFormsApplication2\WindowsFormsApplication2\obj\x86\Debug\WindowsFormsApplication2.Properties.Resources.resources

     文件        505  2011-06-04 11:09  WindowsFormsApplication2\WindowsFormsApplication2\Program.cs

     文件       1404  2011-06-04 10:25  WindowsFormsApplication2\WindowsFormsApplication2\Properties\AssemblyInfo.cs

     文件       2898  2011-06-04 10:25  WindowsFormsApplication2\WindowsFormsApplication2\Properties\Resources.Designer.cs

     文件       5612  2011-06-04 10:25  WindowsFormsApplication2\WindowsFormsApplication2\Properties\Resources.resx

     文件       1109  2011-06-04 10:25  WindowsFormsApplication2\WindowsFormsApplication2\Properties\Settings.Designer.cs

     文件        249  2011-06-04 10:25  WindowsFormsApplication2\WindowsFormsApplication2\Properties\Settings.settings

     文件       3707  2011-06-04 11:15  WindowsFormsApplication2\WindowsFormsApplication2\WindowsFormsApplication2.csproj

     文件        914  2011-06-04 10:26  WindowsFormsApplication2\WindowsFormsApplication2.sln

    ..A..H.     20992  2011-06-04 11:46  WindowsFormsApplication2\WindowsFormsApplication2.suo

     目录          0  2011-06-04 10:25  WindowsFormsApplication2\WindowsFormsApplication2\obj\x86\Debug\TempPE

     目录          0  2011-06-04 11:43  WindowsFormsApplication2\WindowsFormsApplication2\obj\x86\Debug

     目录          0  2011-06-04 10:26  WindowsFormsApplication2\WindowsFormsApplication2\bin\Debug

     目录          0  2011-06-04 11:05  WindowsFormsApplication2\WindowsFormsApplication2\bin\Release

     目录          0  2011-06-04 10:25  WindowsFormsApplication2\WindowsFormsApplication2\obj\x86

............此处省略8个文件信息

评论

共有 条评论