2017-07-08 49 views
-2

没有显示运行时的NotifyIcon以上是我Code.Only声音是有我怎么能NotifyIcon的设置下,定时器在C#

private void timerS_Tick(object sender, EventArgs ex) 
    { 

      if (File.Exists(path) == true) 
      { 
       notifyIcon1.BalloonTipText = "PLEASE CHECK ASHIDA\\MESSAGE\\Temp.txt"; 
       notifyIcon1.BalloonTipTitle = "MESSAGE FROM MUFITHA"; 
       notifyIcon1.ShowBalloonTip(3000); 
       System.Media.SoundPlayer s = new System.Media.SoundPlayer(); 
       s.SoundLocation = @"\\SERVER-HARMONY\Ashida\MESSAGE\click_x.wav"; 
       s.Play(); 
       timerS.Stop(); 
       notifyIcon1.Dispose(); 
       timerS.Enabled = false; 
       return; 
      }                
+0

你正在处理图标,如果块,我看不到你在哪里创建它。这可能是你的问题的一部分。 – pstrjds

+0

private void timerS_Tick(object sender,EventArgs ex) { //这里我打电话给我的代码 } – fidha

回答

0

前声明:

notifyIcon1.ShowBalloonTip(3000); 

尝试插入语句:

notifyIcon1.Visible = true; 
+0

谢谢。我知道了 – fidha