Skip to content

Commit

Permalink
Cleanup after adding icons to tray menu
Browse files Browse the repository at this point in the history
  • Loading branch information
hanselb committed Sep 10, 2016
1 parent 5adea3d commit 3607524
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions HyperionScreenCap/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,39 +33,29 @@ public Form1()

#region TrayIcon


// Add menu icons
var trayMenuIcons = new ContextMenuStrip();
trayMenuIcons.Items.Add("Change monitor index", Resources.television__pencil.ToBitmap(), onChangeMonitor);


// Create a simple tray menu with only one item.

for (int i = 0; i < DisplayMonitor.EnumerateMonitors().Length; i++)
{
((ToolStripMenuItem) trayMenuIcons.Items[0]).DropDownItems.Add(string.Format("#{0}", i), Resources.television__arrow.ToBitmap(), onChangeMonitor);
((ToolStripMenuItem) trayMenuIcons.Items[0]).DropDownItems.Add(string.Format("#{0}", i),
Resources.television__arrow.ToBitmap(), onChangeMonitor);
}


trayMenuIcons.Items.Add("Setup", Resources.gear.ToBitmap(), onSetup);
trayMenuIcons.Items.Add("Exit", Resources.cross.ToBitmap(), onExit);

// Create a simple tray menu with only one item.
var trayMenu = new ContextMenu();


// trayMenu.MenuItems.Add(menuItemChangeMonitor);
trayMenu.MenuItems.Add("Setup", onSetup);
trayMenu.MenuItems.Add("Exit", onExit);

TrayIcon = new NotifyIcon {Text = @"Hyperion Screen Capture (Not Connected)"};
TrayIcon.DoubleClick += TrayIcon_DoubleClick;
TrayIcon.Icon = Resources.Hyperion_disabled;

// Add menu to tray icon and show it.
TrayIcon.ContextMenuStrip = trayMenuIcons;
//TrayIcon.ContextMenu = trayMenu;

TrayIcon.Visible = true;

Settings.LoadSetttings();
Expand Down

0 comments on commit 3607524

Please sign in to comment.