winform最小化后隐藏到右下角,单击或双击后恢复(c#)
我知道这个方法怎么写,我不知道什么时候执行。。(非MainForm_SizeChanged)privatevoidnormalForm()//恢复{this.Visibl...
我知道这个方法怎么写,我不知道什么时候执行。。(非MainForm_SizeChanged)
private void normalForm()//恢复 { this.Visible = true; this.WindowState=FormWindowState.Normal; } private void minForm()//隐藏 { WindowState = FormWindowState.Minimized; this.Visible = false; this.notifyIcon1.Visible = true; } 展开
private void normalForm()//恢复 { this.Visible = true; this.WindowState=FormWindowState.Normal; } private void minForm()//隐藏 { WindowState = FormWindowState.Minimized; this.Visible = false; this.notifyIcon1.Visible = true; } 展开
展开全部
像QQ那样最小化到托盘吗?是的话就是notifyIcon控件。下面的代码
private void MainForm_Resize(object sender, EventArgs e)
{
if (this.WindowState == FormWindowState.Minimized)
{
this.WindowState = FormWindowState.Normal;
notifyIcon1.Visible = true;
this.Hide();
this.ShowInTaskbar = false;
}
}
private void notifyIcon1_MouseClick(object sender, MouseEventArgs e)
{
if (this.ShowInTaskbar == false)
notifyIcon1.Visible = true;
this.ShowInTaskbar = true;
this.Show();
this.Activate();
this.WindowState = FormWindowState.Normal;
}
private void MainForm_Resize(object sender, EventArgs e)
{
if (this.WindowState == FormWindowState.Minimized)
{
this.WindowState = FormWindowState.Normal;
notifyIcon1.Visible = true;
this.Hide();
this.ShowInTaskbar = false;
}
}
private void notifyIcon1_MouseClick(object sender, MouseEventArgs e)
{
if (this.ShowInTaskbar == false)
notifyIcon1.Visible = true;
this.ShowInTaskbar = true;
this.Show();
this.Activate();
this.WindowState = FormWindowState.Normal;
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询