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;
}
相关文章
winform导出dataviewgrid数据为excel的方法
这篇文章主要介绍了winform导出dataviewgrid数据为excel的方法,可实现将dataViewGrid视图中的数据导出为excel格式的功能,非常具有实用价值,需要的朋友可以参考下2015-01-01WinForm中实现picturebox自适应图片大小的方法
这篇文章主要介绍了WinForm中实现picturebox自适应图片大小的方法,涉及pictureBox控件相关属性设置技巧,需要的朋友可以参考下2017-05-05
最新评论