码迷,mamicode.com
首页 > 其他好文 > 详细

07菜单及右下角小图标的练习

时间:2016-12-26 00:09:55      阅读:168      评论:0      收藏:0      [点我收藏+]

标签:date   task   object   label   not   最大   strip   eve   min   

    private void 退出ToolStripMenuItem_Click(object sender, EventArgs e) //退出菜单方法
        {
            //this.Close();
            Application.Exit();//建议使用该关闭语句
        }

        private void timer1_Tick(object sender, EventArgs e) //时间方法
        {
            toolStripStatusLabel1.Text = DateTime.Now.ToString();
        }
        private void Form1_Resize(object sender, EventArgs e)//窗口最大最小改变后产生的效果
        {
            if (this.WindowState == FormWindowState.Minimized)
            {
                notifyIcon1.Visible = true;
                this.Visible = false;
            }
            else
            {
                notifyIcon1.Visible = false;
                this.Visible = true;
            }
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            //if (this.WindowState == FormWindowState.Minimized)
            //{
            //    ShowInTaskbar = false;
            //}
        }

        //private void notifyIcon1_MouseDoubleClick(object sender, MouseEventArgs e)
        //{
        //    this.Visible = true;
        //    this.WindowState = FormWindowState.Normal;
        //}
        private void notifyIcon1_DoubleClick(object sender, EventArgs e) //右下角小图标相关设定
        {
            this.Visible = true;
            this.WindowState = FormWindowState.Normal;
        }
        private void 显示ToolStripMenuItem_Click(object sender, EventArgs e) //双击右下角图标显示程序窗口
        {
            notifyIcon1_DoubleClick(sender, e);
        }

 

07菜单及右下角小图标的练习

标签:date   task   object   label   not   最大   strip   eve   min   

原文地址:http://www.cnblogs.com/xcyg/p/6220540.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!