请问:怎么让程序最小化后托盘? 看看这个帖子http://community.csdn.net/Expert/topic/2641/2641572.xml?temp=.6975519 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 /// <summary>/// 显示隐藏窗口控制函数/// </summary>/// <param name="isShow"></param>private void ShowHideWindow(bool isShow){ if(isShow) { if(this.ShowInTaskbar==false) { this.ShowInTaskbar = true; this.Show(); this.WindowState = FormWindowState.Normal; } else { if(this.WindowState == FormWindowState.Minimized) { this.WindowState = FormWindowState.Normal; } } this.Activate(); } else { if(this.ShowInTaskbar == true) { this.Hide(); this.ShowInTaskbar = false; } }} 用NotifyIconthis.notifyIcon1.Visible=true;this.WindowState=System.Windows.Forms.FormWindowState.Normal;this.WindowState=System.Windows.Forms.FormWindowState.Minimized;设置Form最小化或正常 private void YourForm_SizeChanged(object sender, System.EventArgs e){ if(this.WindowState==FormWindowState.Minimized) { this.Hide(); }} 求正则表达式 WCF一个奇怪的问题请大家帮忙 怎么在.NET2005下显示指示灯? 怎样做一个无刷新的Tabstrip和multipage? 写文件问题 如何更新文件中某特定行 未定义入口点,编译错误 如何实现锁定IP?? 如何生成N个空格??? 将其编译成扩展名为dll的应用程序组件,怎么个编译法,具体的步骤是什么? 为什么Class1没有构造函数 怎样在c#写的web程序里,将datagrid中的数据导出到文本或excel里 file = new File(sourceName);这句话有什么问题吗?
/// 显示隐藏窗口控制函数
/// </summary>
/// <param name="isShow"></param>
private void ShowHideWindow(bool isShow)
{
if(isShow)
{
if(this.ShowInTaskbar==false)
{
this.ShowInTaskbar = true;
this.Show();
this.WindowState = FormWindowState.Normal;
}
else
{
if(this.WindowState == FormWindowState.Minimized)
{
this.WindowState = FormWindowState.Normal;
}
}
this.Activate();
}
else
{
if(this.ShowInTaskbar == true)
{
this.Hide();
this.ShowInTaskbar = false;
}
}
}
this.notifyIcon1.Visible=true;
this.WindowState=System.Windows.Forms.FormWindowState.Normal;
this.WindowState=System.Windows.Forms.FormWindowState.Minimized;
设置Form最小化或正常
{
if(this.WindowState==FormWindowState.Minimized)
{
this.Hide();
}
}