基本信息
源码名称:类迅雷的悬浮窗程序
源码大小:0.06M
文件格式:.rar
开发语言:C#
更新时间:2013-12-30
   友情提示:(无需注册或充值,赞助后即可获取资源下载链接)

     嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):813200300

本次赞助数额为: 2 元 
   源码介绍

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;
using System.Drawing.Drawing2D;//修改窗体的Paint事件,美化界面,这里做一个渐变背景,需要引入
using System.Runtime.InteropServices;

namespace sprite
{
    public partial class flash : Form
    {
        public flash()
        {
            InitializeComponent();
            //设置其属性
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
            this.MaximizeBox = false;
            this.MinimizeBox = false;
            this.Opacity = 0.5;
        }

        private void flash_Load(object sender, EventArgs e)
        {
            //设置窗体的OnLoad事件
            this.Top = 20;
            this.Left = Screen.PrimaryScreen.Bounds.Width - 80;
            this.Width = 40;
            this.Height = 40;
        }

        private void flash_Paint(object sender, PaintEventArgs e)
        {
            //美化窗体
            Graphics g = e.Graphics;
            Color FColor = Color.Red;
            Color TColor = Color.Yellow;
            Brush b = new LinearGradientBrush(this.ClientRectangle, FColor, TColor, LinearGradientMode.ForwardDiagonal);
            g.FillRectangle(b, this.ClientRectangle);
        }

        private void flash_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            //双击显示主界面
            FormMain shuangji = new FormMain();
            shuangji.Show();
        }
        [DllImport("user32.dll")]//移动设置
        public static extern bool ReleaseCapture();
        [DllImport("user32.dll")]
        public static extern bool SendMessage(IntPtr hwnd, int wMsg, int wParam, int lParam);
        public const int WM_SYSCOMMAND = 0x0112;
        public const int SC_MOVE = 0xF010;
        public const int HTCAPTION = 0x0002;
        private void flash_MouseDown(object sender, MouseEventArgs e)
        {
            ReleaseCapture();//按下下鼠标事件,以移动小窗体
            SendMessage(this.Handle, WM_SYSCOMMAND, SC_MOVE   HTCAPTION, 0); 
        }

        private void mainformToolStripMenuItem_Click(object sender, EventArgs e)
        {
            //双击显示主界面
            FormMain shuangji = new FormMain();
            shuangji.Show();
        }
        
        private void closeall_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }

        private void aboutToolStripMenuItem_Click(object sender, EventArgs e)
        {
            MessageBox.Show("感谢使用类迅雷的悬浮窗程序程序", "QQ223857666勾月提醒");
        }
    }
}