简单任务栏拖动实现小实例

 // form 类
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;

namespace WindowsApplication3
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        bool m = true;
        System.Drawing.Color color1;
        System.Drawing.Color color2;
        System.Drawing.Color color3;
        System.Drawing.Color color4;
        int with = 0;
        int hight = 0;
        bool l = true;
        public static double Opacity1 = 0;
        int i = 0;
        Point pCursorA;
        Point p;
        System.Drawing.Size axwindsize;
        private void Form1_Load(object sender, EventArgs e)
        {
            color1 = this.menu.BackColor;
            color2 = this.button1.BackColor;
            color3 = this.menuStrip1.BackColor;
            color4 = toolStrip1.BackColor;
            axwindsize= this.axWindowsMediaPlayer1.Size;
        }
        private void MENU_MouseDown(object sender, MouseEventArgs e)///核心代码

        {
            pCursorA = e.Location;
        }

        private void MENU_MouseMove(object sender, MouseEventArgs e)///核心代码
        {
            if (e.Button == MouseButtons.Left)
            {
                int x = (e.X - pCursorA.X);
                this.Left += x;
                int y = (e.Y- pCursorA.Y);
                this.Top += y;
            }
        
        
        }
         private void 最大化F12ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (最大化F12ToolStripMenuItem.Text == "最大化(F12)")
            {
                this.WindowState = FormWindowState.Maximized;
                最大化F12ToolStripMenuItem.Text = "还原(F12)";

                this.axWindowsMediaPlayer1.Size = new System.Drawing.Size( this.Size.Width,this.Size.Height - 30);
                this.menu.BackColor = color1;
                button1.BackColor = color2;
                menuStrip1.BackColor = color3;
                this.toolStripButton1.Height = 0;
                toolStripButton1.Width = 0;
            }
            else
            {
                this.WindowState = FormWindowState.Normal;
                最大化F12ToolStripMenuItem.Text = "最大化(F12)";
                this.axWindowsMediaPlayer1.Size = axwindsize; this.menu.BackColor = color1;
                button1.BackColor = color2;
                menuStrip1.BackColor = color3;
                this.toolStripButton1.Height = hight;
                toolStripButton1.Width = with;
            }

        }

        private void 关闭escToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("确认要退出系统?", "确认", MessageBoxButtons.OKCancel, MessageBoxIcon.Information) == DialogResult.OK)
            {
                axWindowsMediaPlayer1.close();
                this.Dispose();
                Application.Exit();
            }
        }

        private void Form1_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode.ToString() == Keys.Escape.ToString())
            {
                关闭escToolStripMenuItem.Select();
                关闭escToolStripMenuItem_Click(this, null);
            }
        }

        private void menu_DoubleClick(object sender, EventArgs e)
        {
            if (最大化F12ToolStripMenuItem.Text == "最大化(F12)")
            {
                this.WindowState = FormWindowState.Maximized;
                最大化F12ToolStripMenuItem.Text = "还原(F12)";
                this.menu.BackColor = color1;
                button1.BackColor = color2;
                menuStrip1.BackColor = color3;
                this.toolStripButton1.Height = 0;
                toolStripButton1.Width = 0;
                this.axWindowsMediaPlayer1.Size = new System.Drawing.Size(this.Size.Width, this.Size.Height -30);
            }
            else
            {
                this.menu.BackColor = color1;
                button1.BackColor = color2;
                menuStrip1.BackColor = color3;
                this.WindowState = FormWindowState.Normal;
                最大化F12ToolStripMenuItem.Text = "最大化(F12)";
                this.axWindowsMediaPlayer1.Size = axwindsize;
                this.toolStripButton1.Height =hight;
                toolStripButton1.Width = with;
            }

        }

     //登陆显示   private void timer1_Tick(object sender, EventArgs e)
        {
            if (m)
            {
                Opacity1 = Opacity1 + 0.05;
                this.Opacity = Opacity1;
                Console.WriteLine(Opacity1);

                if (Opacity1 == 1)
                {
                    Opacity1 = 0;
                    OPACITY.Stop();
                    Console.WriteLine(Opacity1);
                    m = false;
                }
            }

        }
     private void button1_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }

        private void 最大化ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (最大化F12ToolStripMenuItem.Text == "最大化(F12)")
            {
                this.WindowState = FormWindowState.Maximized;
                最大化F12ToolStripMenuItem.Text = "还原(F12)";
                this.menu.BackColor = color1;
                button1.BackColor = color2;
                menuStrip1.BackColor = color3;
                this.axWindowsMediaPlayer1.Size = new System.Drawing.Size(this.Size.Width, this.Size.Height - 30);
                this.toolStripButton1.Height = 0;
                toolStripButton1.Width = 0;
            }
            else
            {
                this.menu.BackColor = color1;
                button1.BackColor = color2;
                menuStrip1.BackColor = color3;
                this.WindowState = FormWindowState.Normal;
                最大化F12ToolStripMenuItem.Text = "最大化(F12)";
                this.axWindowsMediaPlayer1.Size = axwindsize;
                this.toolStripButton1.Height = hight;
                toolStripButton1.Width =with;
            }
      
        }

        private void 退出ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Application.Exit();
         
        }

        private void notifyIcon1_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            p = new Point(Cursor.Position.X, Cursor.Position.Y);
            this.contextMenuStrip1.Show(p);

        }

        private void menu_MouseClick(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Right)
            {
                p = new Point(Cursor.Position.X, Cursor.Position.Y);
                this.contextMenuStrip1.Show(p);
            }
        }

        private void menu_MouseEnter(object sender, EventArgs e)
        {
            this.toolStripButton1.Height = 0;
            toolStripButton1.Width = 0;
            this.menu.BackColor = color1;
            button1.BackColor = color2;
            menuStrip1.BackColor = color3;
            toolStrip1.BackColor = color4;
        }

        private void menu_MouseLeave(object sender, EventArgs e)
        {
            //if (this.WindowState == FormWindowState.Maximized)
            //{

            //    if (this.menu.BackColor == Color.Black)
            //    {
            //        this.menu.BackColor = color1;
            //        button1.BackColor = color2;
            //        menuStrip1.BackColor = color3;
            //    }
            //    else
            //    {
            //        this.menu.BackColor = Color.Black;
            //        button1.BackColor = Color.Black;
            //        menuStrip1.BackColor = Color.Black;
            //    }
            //}
        }

        private void menu_MouseHover(object sender, EventArgs e)
        {
            if (this.WindowState == FormWindowState.Maximized)
            {
                if (this.menu.BackColor == Color.Black)
                {
                    this.menu.BackColor = color1;
                    button1.BackColor = color2;
                    menuStrip1.BackColor = color3;
                    toolStrip1.BackColor = color4;
                   
                }
                else
                {   
                    this.menu.BackColor = Color.Black;
                    button1.BackColor = Color.Black;
                    menuStrip1.BackColor = Color.Black;

                    toolStrip1.BackColor = Color.Black;
                }


            }
        }

        private void menu_Click(object sender, EventArgs e)
        {
            if (this.WindowState == FormWindowState.Maximized)
            {
              
                    this.menu.BackColor = color1;
                    button1.BackColor = color2;
                    menuStrip1.BackColor = color3;

                    toolStrip1.BackColor = color4;


            }
        }

        private void opecity(object sender, EventArgs e)
        {

            System.Windows.Forms.ToolStripMenuItem bt = (System.Windows.Forms.ToolStripMenuItem)sender;
            if (bt.Text == "100%")
                this.Opacity = 1;
            if (bt.Text == "80%")
              this.Opacity = 0.8;
            if (bt.Text == "60%")
                this.Opacity = 0.6;
            if (bt.Text == "40%")
                this.Opacity = 0.4;
            if (bt.Text == "20%")
                this.Opacity = 0.2;
            if (bt.Text == "10%")
                this.Opacity = 0.1;
    
        }

        private void toolStripMenuItem8_Click(object sender, EventArgs e)
        {
            this.Opacity = 0.5;
        }

        private void axWindowsMediaPlayer1_Enter(object sender, EventArgs e)
        {

        }

        private void toolStrip1_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
        {
            System.Diagnostics.Process.Start("http://www.google.com");
        }
 
   }
}
/
///
//
/Form1.Designer.cs

namespace WindowsApplication3
{
    partial class Form1
    {
        /// <summary>
        /// 必需的设计器变量。
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// 清理所有正在使用的资源。
        /// </summary>
        /// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows 窗体设计器生成的代码

        /// <summary>
        /// 设计器支持所需的方法 - 不要
        /// 使用代码编辑器修改此方法的内容。
        /// </summary>
        private void InitializeComponent()
        {
            this.components = new System.ComponentModel.Container();
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
            this.PLANT = new System.Windows.Forms.Panel();
            this.toolStrip1 = new System.Windows.Forms.ToolStrip();
            this.toolStripButton1 = new System.Windows.Forms.ToolStripButton();
            this.panel2 = new System.Windows.Forms.Panel();
            this.label1 = new System.Windows.Forms.Label();
            this.menuStrip1 = new System.Windows.Forms.MenuStrip();
            this.最大化F12ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
            this.关闭escToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
            this.menu = new System.Windows.Forms.Label();
            this.button1 = new System.Windows.Forms.Button();
            this.axWindowsMediaPlayer1 = new AxWMPLib.AxWindowsMediaPlayer();
            this.OPACITY = new System.Windows.Forms.Timer(this.components);
            this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
            this.最大化ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
            this.退出ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
            this.透明度ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
            this.toolStripMenuItem2 = new System.Windows.Forms.ToolStripMenuItem();
            this.toolStripMenuItem3 = new System.Windows.Forms.ToolStripMenuItem();
            this.toolStripMenuItem4 = new System.Windows.Forms.ToolStripMenuItem();
            this.toolStripMenuItem5 = new System.Windows.Forms.ToolStripMenuItem();
            this.toolStripMenuItem6 = new System.Windows.Forms.ToolStripMenuItem();
            this.toolStripMenuItem7 = new System.Windows.Forms.ToolStripMenuItem();
            this.toolStripMenuItem8 = new System.Windows.Forms.ToolStripMenuItem();
            this.菜单栏拖放演示 = new System.Windows.Forms.NotifyIcon(this.components);
            this.PLANT.SuspendLayout();
            this.toolStrip1.SuspendLayout();
            this.panel2.SuspendLayout();
            this.menuStrip1.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.axWindowsMediaPlayer1)).BeginInit();
            this.contextMenuStrip1.SuspendLayout();
            this.SuspendLayout();
            //
            // PLANT
            //
            this.PLANT.BackColor = System.Drawing.Color.Black;
            this.PLANT.Controls.Add(this.toolStrip1);
            this.PLANT.Controls.Add(this.panel2);
            this.PLANT.Controls.Add(this.menuStrip1);
            this.PLANT.Controls.Add(this.menu);
            this.PLANT.Controls.Add(this.button1);
            this.PLANT.Controls.Add(this.axWindowsMediaPlayer1);
            this.PLANT.Dock = System.Windows.Forms.DockStyle.Fill;
            this.PLANT.Location = new System.Drawing.Point(0, 0);
            this.PLANT.Name = "PLANT";
            this.PLANT.Size = new System.Drawing.Size(389, 273);
            this.PLANT.TabIndex = 0;
            //
            // toolStrip1
            //
            this.toolStrip1.BackColor = System.Drawing.SystemColors.MenuHighlight;
            this.toolStrip1.Dock = System.Windows.Forms.DockStyle.None;
            this.toolStrip1.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden;
            this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.toolStripButton1});
            this.toolStrip1.Location = new System.Drawing.Point(4, -2);
            this.toolStrip1.Name = "toolStrip1";
            this.toolStrip1.RenderMode = System.Windows.Forms.ToolStripRenderMode.System;
            this.toolStrip1.Size = new System.Drawing.Size(26, 25);
            this.toolStrip1.TabIndex = 12;
            this.toolStrip1.Text = "toolStrip1";
            this.toolStrip1.ItemClicked += new System.Windows.Forms.ToolStripItemClickedEventHandler(this.toolStrip1_ItemClicked);
            //
            // toolStripButton1
            //
            this.toolStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
            this.toolStripButton1.ForeColor = System.Drawing.Color.CornflowerBlue;
            this.toolStripButton1.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton1.Image")));
            this.toolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.toolStripButton1.Name = "toolStripButton1";
            this.toolStripButton1.Size = new System.Drawing.Size(23, 22);
            this.toolStripButton1.Text = "toolStripButton1";
            this.toolStripButton1.ToolTipText = "菜单栏演示";
            //
            // panel2
            //
            this.panel2.Controls.Add(this.label1);
            this.panel2.Dock = System.Windows.Forms.DockStyle.Bottom;
            this.panel2.Location = new System.Drawing.Point(0, 238);
            this.panel2.Name = "panel2";
            this.panel2.Size = new System.Drawing.Size(389, 35);
            this.panel2.TabIndex = 11;
            //
            // label1
            //
            this.label1.AllowDrop = true;
            this.label1.AutoEllipsis = true;
            this.label1.BackColor = System.Drawing.SystemColors.GradientActiveCaption;
            this.label1.Dock = System.Windows.Forms.DockStyle.Bottom;
            this.label1.Location = new System.Drawing.Point(0, 34);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(389, 1);
            this.label1.TabIndex = 0;
            //
            // menuStrip1
            //
            this.menuStrip1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.menuStrip1.BackColor = System.Drawing.SystemColors.MenuHighlight;
            this.menuStrip1.Dock = System.Windows.Forms.DockStyle.None;
            this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.最大化F12ToolStripMenuItem,
            this.关闭escToolStripMenuItem});
            this.menuStrip1.Location = new System.Drawing.Point(229, 0);
            this.menuStrip1.Name = "menuStrip1";
            this.menuStrip1.Size = new System.Drawing.Size(162, 24);
            this.menuStrip1.TabIndex = 8;
            this.menuStrip1.Text = "菜单栏";
            //
            // 最大化F12ToolStripMenuItem
            //
            this.最大化F12ToolStripMenuItem.Name = "最大化F12ToolStripMenuItem";
            this.最大化F12ToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.F12;
            this.最大化F12ToolStripMenuItem.Size = new System.Drawing.Size(83, 20);
            this.最大化F12ToolStripMenuItem.Text = "最大化(F12)";
            this.最大化F12ToolStripMenuItem.Click += new System.EventHandler(this.最大化F12ToolStripMenuItem_Click);
            //
            // 关闭escToolStripMenuItem
            //
            this.关闭escToolStripMenuItem.Name = "关闭escToolStripMenuItem";
            this.关闭escToolStripMenuItem.Size = new System.Drawing.Size(71, 20);
            this.关闭escToolStripMenuItem.Text = "关闭(esc)";
            this.关闭escToolStripMenuItem.Click += new System.EventHandler(this.关闭escToolStripMenuItem_Click);
            //
            // menu
            //
            this.menu.BackColor = System.Drawing.SystemColors.MenuHighlight;
            this.menu.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
            this.menu.ForeColor = System.Drawing.Color.Black;
            this.menu.Location = new System.Drawing.Point(-3, 0);
            this.menu.Name = "menu";
            this.menu.Size = new System.Drawing.Size(1380, 24);
            this.menu.TabIndex = 0;
            this.menu.Text = "     菜单栏拖放演示";
            this.menu.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
            this.menu.DoubleClick += new System.EventHandler(this.menu_DoubleClick);
            this.menu.MouseLeave += new System.EventHandler(this.menu_MouseLeave);
            this.menu.Click += new System.EventHandler(this.menu_Click);
            this.menu.MouseDown += new System.Windows.Forms.MouseEventHandler(this.MENU_MouseDown);
            this.menu.MouseMove += new System.Windows.Forms.MouseEventHandler(this.MENU_MouseMove);
            this.menu.MouseClick += new System.Windows.Forms.MouseEventHandler(this.menu_MouseClick);
            this.menu.MouseEnter += new System.EventHandler(this.menu_MouseEnter);
            this.menu.MouseHover += new System.EventHandler(this.menu_MouseHover);
            //
            // button1
            //
            this.button1.BackColor = System.Drawing.Color.Red;
            this.button1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
            this.button1.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.button1.Location = new System.Drawing.Point(0, 6);
            this.button1.Name = "button1";
            this.button1.Size = new System.Drawing.Size(10, 13);
            this.button1.TabIndex = 9;
            this.button1.UseVisualStyleBackColor = false;
            this.button1.Click += new System.EventHandler(this.button1_Click);
            //
            // axWindowsMediaPlayer1
            //
            this.axWindowsMediaPlayer1.Enabled = true;
            this.axWindowsMediaPlayer1.Location = new System.Drawing.Point(0, 25);
            this.axWindowsMediaPlayer1.Name = "axWindowsMediaPlayer1";
            this.axWindowsMediaPlayer1.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("axWindowsMediaPlayer1.OcxState")));
            this.axWindowsMediaPlayer1.Size = new System.Drawing.Size(389, 245);
            this.axWindowsMediaPlayer1.TabIndex = 10;
            this.axWindowsMediaPlayer1.Enter += new System.EventHandler(this.axWindowsMediaPlayer1_Enter);
            //
            // OPACITY
            //
            this.OPACITY.Enabled = true;
            this.OPACITY.Interval = 300;
            this.OPACITY.Tick += new System.EventHandler(this.timer1_Tick);
            //
            // contextMenuStrip1
            //
            this.contextMenuStrip1.BackColor = System.Drawing.SystemColors.ButtonHighlight;
            this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.最大化ToolStripMenuItem,
            this.退出ToolStripMenuItem,
            this.透明度ToolStripMenuItem});
            this.contextMenuStrip1.Name = "contextMenuStrip1";
            this.contextMenuStrip1.RenderMode = System.Windows.Forms.ToolStripRenderMode.System;
            this.contextMenuStrip1.Size = new System.Drawing.Size(107, 70);
            this.contextMenuStrip1.Text = "千千";
            //
            // 最大化ToolStripMenuItem
            //
            this.最大化ToolStripMenuItem.BackgroundImage = global::WindowsApplication3.Properties.Resources.未命名_12;
            this.最大化ToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255)))));
            this.最大化ToolStripMenuItem.Name = "最大化ToolStripMenuItem";
            this.最大化ToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
            this.最大化ToolStripMenuItem.Text = "缩放";
            this.最大化ToolStripMenuItem.Click += new System.EventHandler(this.最大化ToolStripMenuItem_Click);
            //
            // 退出ToolStripMenuItem
            //
            this.退出ToolStripMenuItem.Name = "退出ToolStripMenuItem";
            this.退出ToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
            this.退出ToolStripMenuItem.Text = "退出";
            this.退出ToolStripMenuItem.Click += new System.EventHandler(this.退出ToolStripMenuItem_Click);
            //
            // 透明度ToolStripMenuItem
            //
            this.透明度ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.toolStripMenuItem2,
            this.toolStripMenuItem3,
            this.toolStripMenuItem4,
            this.toolStripMenuItem5,
            this.toolStripMenuItem6,
            this.toolStripMenuItem7,
            this.toolStripMenuItem8});
            this.透明度ToolStripMenuItem.ForeColor = System.Drawing.SystemColors.ControlText;
            this.透明度ToolStripMenuItem.Name = "透明度ToolStripMenuItem";
            this.透明度ToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
            this.透明度ToolStripMenuItem.Text = "透明度";
            //
            // toolStripMenuItem2
            //
            this.toolStripMenuItem2.Name = "toolStripMenuItem2";
            this.toolStripMenuItem2.Size = new System.Drawing.Size(152, 22);
            this.toolStripMenuItem2.Text = "100%";
            this.toolStripMenuItem2.Click += new System.EventHandler(this.opecity);
            //
            // toolStripMenuItem3
            //
            this.toolStripMenuItem3.Name = "toolStripMenuItem3";
            this.toolStripMenuItem3.Size = new System.Drawing.Size(152, 22);
            this.toolStripMenuItem3.Text = "80%";
            this.toolStripMenuItem3.Click += new System.EventHandler(this.opecity);
            //
            // toolStripMenuItem4
            //
            this.toolStripMenuItem4.Name = "toolStripMenuItem4";
            this.toolStripMenuItem4.Size = new System.Drawing.Size(152, 22);
            this.toolStripMenuItem4.Text = "60%";
            this.toolStripMenuItem4.Click += new System.EventHandler(this.opecity);
            //
            // toolStripMenuItem5
            //
            this.toolStripMenuItem5.Name = "toolStripMenuItem5";
            this.toolStripMenuItem5.Size = new System.Drawing.Size(152, 22);
            this.toolStripMenuItem5.Text = "40%";
            this.toolStripMenuItem5.Click += new System.EventHandler(this.opecity);
            //
            // toolStripMenuItem6
            //
            this.toolStripMenuItem6.Name = "toolStripMenuItem6";
            this.toolStripMenuItem6.Size = new System.Drawing.Size(152, 22);
            this.toolStripMenuItem6.Text = "20%";
            this.toolStripMenuItem6.Click += new System.EventHandler(this.opecity);
            //
            // toolStripMenuItem7
            //
            this.toolStripMenuItem7.Name = "toolStripMenuItem7";
            this.toolStripMenuItem7.Size = new System.Drawing.Size(152, 22);
            this.toolStripMenuItem7.Text = "10%";
            this.toolStripMenuItem7.Click += new System.EventHandler(this.opecity);
            //
            // toolStripMenuItem8
            //
            this.toolStripMenuItem8.Name = "toolStripMenuItem8";
            this.toolStripMenuItem8.Size = new System.Drawing.Size(152, 22);
            this.toolStripMenuItem8.Text = "50%";
            this.toolStripMenuItem8.DoubleClick += new System.EventHandler(this.toolStripMenuItem8_Click);
            this.toolStripMenuItem8.Click += new System.EventHandler(this.toolStripMenuItem8_Click);
            //
            // 菜单栏拖放演示
            //
            this.菜单栏拖放演示.Icon = ((System.Drawing.Icon)(resources.GetObject("菜单栏拖放演示.Icon")));
            this.菜单栏拖放演示.Text = "菜单栏拖放演示";
            this.菜单栏拖放演示.Visible = true;
            this.菜单栏拖放演示.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.notifyIcon1_MouseDoubleClick);
            //
            // Form1
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.BackColor = System.Drawing.Color.Black;
            this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
            this.CancelButton = this.button1;
            this.ClientSize = new System.Drawing.Size(389, 273);
            this.Controls.Add(this.PLANT);
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
            this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
            this.MainMenuStrip = this.menuStrip1;
            this.Name = "Form1";
            this.Opacity = 0;
            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
            this.Text = "菜单栏拖动演示";
            this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Form1_KeyDown);
            this.Load += new System.EventHandler(this.Form1_Load);
            this.PLANT.ResumeLayout(false);
            this.PLANT.PerformLayout();
            this.toolStrip1.ResumeLayout(false);
            this.toolStrip1.PerformLayout();
            this.panel2.ResumeLayout(false);
            this.menuStrip1.ResumeLayout(false);
            this.menuStrip1.PerformLayout();
            ((System.ComponentModel.ISupportInitialize)(this.axWindowsMediaPlayer1)).EndInit();
            this.contextMenuStrip1.ResumeLayout(false);
            this.ResumeLayout(false);

        }

        #endregion

        private System.Windows.Forms.Panel PLANT;
        private System.Windows.Forms.Label menu;
        private System.Windows.Forms.MenuStrip menuStrip1;
        private System.Windows.Forms.ToolStripMenuItem 最大化F12ToolStripMenuItem;
        private System.Windows.Forms.ToolStripMenuItem 关闭escToolStripMenuItem;
        private System.Windows.Forms.Timer OPACITY;
        private System.Windows.Forms.Button button1;
        private AxWMPLib.AxWindowsMediaPlayer axWindowsMediaPlayer1;
        private System.Windows.Forms.Panel panel2;
        private System.Windows.Forms.ContextMenuStrip contextMenuStrip1;
        private System.Windows.Forms.ToolStripMenuItem 最大化ToolStripMenuItem;
        private System.Windows.Forms.ToolStripMenuItem 退出ToolStripMenuItem;
        private System.Windows.Forms.NotifyIcon 菜单栏拖放演示;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.ToolStripMenuItem 透明度ToolStripMenuItem;
        private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem2;
        private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem3;
        private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem4;
        private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem5;
        private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem6;
        private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem7;
        private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem8;
        private System.Windows.Forms.ToolStrip toolStrip1;
        private System.Windows.Forms.ToolStripButton toolStripButton1;
    }
}

 

//

转载于:https://www.cnblogs.com/dingxuedong/archive/2009/09/22/1571977.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值