日期:2014-05-18  浏览次数:21007 次

NotifyIcon的气球提示为何第一次不显示而以后可以显示呢?
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);
  }
  }

第一次窗口最小化,气球提示不显示,但是双击托盘图标显示窗口后再最小化以后都显示了,为什么呢?怎么玩解决?

------解决方案--------------------
this.notifyIcon1.ShowBalloonTip(3000);
this.notifyIcon1.Visible = true;

换下顺序试试
------解决方案--------------------
探讨

引用:
this.notifyIcon1.ShowBalloonTip(3000);
this.notifyIcon1.Visible = true;

换下顺序试试


按照您的换下顺序更糟了,原来的顺序除了第一次不显示,以后的每次最小化都显示,换了顺序,以后每次最小化都不一定显示了,但是有时候显示
奇怪

------解决方案--------------------
this.Hide();
this.notifyIcon1.Visible = true;
this.notifyIcon1.ShowBalloonTip(3000);
=>
this.notifyIcon1.Visible = true;
this.notifyIcon1.ShowBalloonTip(3000);
this.Hide();

------解决方案--------------------
就是ico是在这个最小化之后才动态创建的,并且有一定的时间延时
----------------------------------------------------
你让它在第一次最小化之前创建。