C#怎样才能实现窗体最小化到托盘呢?
更新时间:2007年03月09日 00:00:00 作者:
private void Form1_Resize(object sender, System.EventArgs e) {
if (this.WindowState == FormWindowState.Minimized) {
this.Visible = false;
this.notifyIcon1.Visible = true;
}
}
private void notifyIcon1_Click(object sender, System.EventArgs e) {
this.Visible = true;
this.WindowState = FormWindowState.Normal;
this.notifyIcon1.Visible = false;
}
if (this.WindowState == FormWindowState.Minimized) {
this.Visible = false;
this.notifyIcon1.Visible = true;
}
}
private void notifyIcon1_Click(object sender, System.EventArgs e) {
this.Visible = true;
this.WindowState = FormWindowState.Normal;
this.notifyIcon1.Visible = false;
}
相关文章
C# Windows API应用之基于FlashWindowEx实现窗口闪烁的方法
这篇文章主要介绍了C# Windows API应用之基于FlashWindowEx实现窗口闪烁的方法,结合实例形式分析了Windows API函数FlashWindowEx的功能、定义及实现窗口闪烁的相关技巧,需要的朋友可以参考下2016-08-08Windows系统中C#调用WinRAR来压缩和解压缩文件的方法
这篇文章主要介绍了Windows系统中C#调用WinRAR来压缩和解压缩文件的方法,个人感觉在Windows中WinRAR相对7-zip更加稳定一些,需要的朋友可以参考下2016-04-04C# WinForm 登录界面的图片验证码(区分大小写+不区分大小写)
这篇文章主要介绍了C# WinForm 登录界面的图片验证码(区分大小写+不区分大小写),文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧2020-02-02
最新评论