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;
}
}
}
文章來源:http://www.cnblogs.com/wangdetian168/archive/2008/09/06/1285664.html