NotifyIcon未在播放按钮事件C#中显示BalloonTip

问题描述:

我正在使用音乐播放器,我想让NotifyIcon显示一个气球提示,显示当前歌曲的标题。



我有播放按钮,这将使播放器开始发出一个mp3文件,在同一个按钮事件中,我放置了我的notifyIcon balloonTip设置。但它没有显示,我一直在寻找调试模式的错误,但它没有弹出其他任何东西。



我的代码:

I'm working in a music player, I want a NotifyIcon to show a balloonTip displaying the title of the current song.

I have the play button, which will make the player start sounding a mp3 file, in the same button event, I placed my notifyIcon balloonTip set. But it isn't showing and I have been looking for errors on Debugging Mode but it did not popup anything else.

My code:

private void playBtn_Click(object sender, EventArgs e) //Play Button
    {
      player.URL = @"C:/myFile.mp3";
      notifyIcon2.BalloonTipText = player.currentMedia.getItemInfo("Title") + " - " + player.currentMedia.getItemInfo("Artist");
      notifyIcon2.ShowBalloonTip(1000);





注意:玩家正在工作,什么是无效的notifyIcon balloonTip。



请帮助我。在此先感谢 - CCB



NOTE: The player is working, what isn't working is the notifyIcon balloonTip.

Please help me. Thanks in Advance - CCB

您是否已将notifyIcon2设置为可见?
Have you set the notifyIcon2 to visible?


notifyIcon control 必须设置为图标它将显示在系统托盘上

这是让你的程序不可见的原因吗?
notifyIcon control must be set a icon and it will be shown on systray
is this reason of making your program unvisible?