nttest il y a 6 ans
Parent
commit
e162af079d
1 fichiers modifiés avec 6 ajouts et 3 suppressions
  1. 6 3
      src/AppModels/ExtendedNotifyIcon.cs

+ 6 - 3
src/AppModels/ExtendedNotifyIcon.cs

@@ -24,11 +24,14 @@ namespace NTMiner {
                 Icon = icon,
                 Visible = isMinerStudio || NTMinerRoot.GetIsShowNotifyIcon(),
                 Text = text,
-                ContextMenu = new ContextMenu()
+                ContextMenuStrip = new ContextMenuStrip {
+                    BackColor = Color.White,
+                    ShowImageMargin = false
+                }
             };
-            _targetNotifyIcon.ContextMenu.MenuItems.Add(new MenuItem("退出" + text, (sender, e) => {
+            _targetNotifyIcon.ContextMenuStrip.Items.Add("退出" + text, null, (sender, e)=> {
                 VirtualRoot.Execute(new CloseNTMinerCommand());
-            }));
+            });
             _targetNotifyIcon.MouseDown += (object sender, MouseEventArgs e) => {
                 if (e.Button == MouseButtons.Left) {
                     VirtualRoot.Execute(new ShowMainWindowCommand(isToggle: true));