程序启动时,如何隐藏窗口 我用C#写了一个简单软件,现在我想启动它的时候,让它隐藏到窗口的右下角,点击窗口右下角的图标,在还原到屏幕窗口. 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 使用NotifyIcon启动时候this.WindowState = FormWindowState.Minimized;this.ShowInTaskbar = false;双击notifyIconthis.WindowState = FormWindowState.Normal;this.ShowInTaskbar = true; NotifyIcon 是一个控件,兄弟~ private void notifyIcon1_MouseDoubleClick(object sender, MouseEventArgs e) { this.Show(); this.WindowState = FormWindowState.Normal; } void Form1_SizeChanged(object sender, System.EventArgs e) { if (this.WindowState == FormWindowState.Minimized) this.Hide(); } private void notifyIcon1_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e) { this.WindowState = FormWindowState.Normal; this.ShowInTaskbar = true; }不知道这段代码放在哪里?this.WindowState = FormWindowState.Minimized;this.ShowInTaskbar = false; 添加一个notifyIcon控件,设置好Icon,默认是没有的,不会显示双击,就出来一个事件如果想窗口在的时候,状态栏不显示,那就默认visible为false,最小化后,改为true,双击后,又为false 设的是WindowState...******要给notifyIcon1设置个icon才会显示出来 private void notifyIcon1_MouseDoubleClick(object sender, MouseEventArgs e) { this.Show(); this.WindowState = FormWindowState.Normal; this.notifyIcon1.Visible = false; } void Form1_SizeChanged(object sender, System.EventArgs e)//添加一个事件 { if (this.WindowState == FormWindowState.Minimized) { this.notifyIcon1.Visible = true; this.Hide(); } } 请教大虾改错 有没使用Mono开发的朋友,大家认识一下。 Winform编程中如何遍历GridViewRow的所有行呢 如何激活datagrid单击事件 listbox里如何让某一行,或多行闪动或变颜色? 高分难题,绝对有难度 现在我实现了定时在局域网内两个数据库服务器间数据的提取,现在想实现定时在总部一台服务器上读取远端多台数据服务器上数据,我要注意哪 C#采集电表数据 Oracle 中去除重复列数据的sql? 使用泛型List时如何操作运算符"++"? 用unrar.dll 将局域网上的.rar 和winrar自解压文件, 解压到本地。 请问网络传输大文件,怎样才能获取最佳性能?
启动时候
this.WindowState = FormWindowState.Minimized;
this.ShowInTaskbar = false;双击notifyIcon
this.WindowState = FormWindowState.Normal;
this.ShowInTaskbar = true;
{
this.Show();
this.WindowState = FormWindowState.Normal;
}
void Form1_SizeChanged(object sender, System.EventArgs e)
{
if (this.WindowState == FormWindowState.Minimized)
this.Hide();
}
{
this.WindowState = FormWindowState.Normal;
this.ShowInTaskbar = true; }
不知道这段代码放在哪里?
this.WindowState = FormWindowState.Minimized;
this.ShowInTaskbar = false;
双击,就出来一个事件
如果想窗口在的时候,状态栏不显示,那就默认visible为false,最小化后,改为true,双击后,又为false
******
要给notifyIcon1设置个icon才会显示出来
{
this.Show();
this.WindowState = FormWindowState.Normal;
this.notifyIcon1.Visible = false;
}
void Form1_SizeChanged(object sender, System.EventArgs e)//添加一个事件
{
if (this.WindowState == FormWindowState.Minimized)
{
this.notifyIcon1.Visible = true;
this.Hide();
}
}