private void Form1_SizeChanged(object sender, EventArgs e)
{
if (this.WindowState == FormWindowState.Minimized)
{
this.ShowInTaskbar = false;
this.Hide();
this.notifyIcon1.Visible = true;
this.notifyIcon1.ShowBalloonTip(3000);
}
}第一次窗口最小化,气球提示不显示,但是双击托盘图标显示窗口后再最小化以后都显示了,为什么呢?怎么玩解决?
{
if (this.WindowState == FormWindowState.Minimized)
{
this.ShowInTaskbar = false;
this.Hide();
this.notifyIcon1.Visible = true;
this.notifyIcon1.ShowBalloonTip(3000);
}
}第一次窗口最小化,气球提示不显示,但是双击托盘图标显示窗口后再最小化以后都显示了,为什么呢?怎么玩解决?
this.notifyIcon1.Visible = true;换下顺序试试
你可以查看下在第一次的时候,是否触发了事件。
this.notifyIcon1.Visible = true;
this.notifyIcon1.ShowBalloonTip(3000);
=>
this.notifyIcon1.Visible = true;
this.notifyIcon1.ShowBalloonTip(3000);
this.Hide();
就是ico是在这个最小化之后才动态创建的,并且有一定的时间延时,这个ico不设置对显示气球提示有影响么?
----------------------------------------------------
你让它在第一次最小化之前创建。