ShowBalloonTip Not Working

后端 未结 5 1107
无人及你
无人及你 2020-12-19 02:00

On Windows 10, the ShowBalloonTip method of NotifyIcon NEVER shows the balloon tip. This would appear to have something to do with Windows itself.<

5条回答
  •  有刺的猬
    2020-12-19 02:20

    Change the Solution Configuration "Debug mode to Release mode" with X64 or X32 Solution platform. It will start work.

     public static NotifyIcon trayIcon;
     trayIcon = new NotifyIcon();
     trayIcon.Icon = new Icon("Images/Test.ico");
     trayIcon.Visible = true; trayIcon.Text=Path.GetFileNameWithoutExtension(AppDomain.CurrentDomain.FriendlyName);
     ContextMenu contextMenu1 = new ContextMenu();
    contextMenu1.MenuItems.Add("Menu2", Menu2_Event);
    contextMenu1.MenuItems.Add("Menu3", Menu3_event);
    contextMenu1.MenuItems.Add("Exit", Close_Click);
    trayIcon.ContextMenu = contextMenu1;
    trayIcon.BalloonTipText = "Hi Test";
    trayIcon.ShowBalloonTip(1000);
    

提交回复
热议问题