如何在c#中的timer下设置notifyicon

时间:2017-07-08 05:41:16

标签: c#

在运行时没有显示notifyIcon?上面是我的Code.Only声音在那里

   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;
            }                                                               

1 个答案:

答案 0 :(得分:0)

在声明之前:

notifyIcon1.ShowBalloonTip(3000);

尝试插入声明:

notifyIcon1.Visible = true;