07菜单及右下角小图标的练习
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了07菜单及右下角小图标的练习相关的知识,希望对你有一定的参考价值。
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菜单及右下角小图标的练习的主要内容,如果未能解决你的问题,请参考以下文章