Skip to content

Commit

Permalink
changed exit menu to a single line of code
Browse files Browse the repository at this point in the history
  • Loading branch information
Gaardsholt committed Sep 23, 2020
1 parent 2115c3f commit c8ca524
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions MenuGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public MenuGenerator(Settings settings)
private static ContextMenuStrip GenerateMenu()
{
var menu = new ContextMenuStrip();
menu.SuspendLayout();

menu.Items.AddRange(new ToolStripItem[]
{
Expand All @@ -30,9 +31,9 @@ private static ContextMenuStrip GenerateMenu()
menu.Items.AddRange(GetColorMenu());
menu.Items.Add(new ToolStripSeparator());

var menuExit = new ToolStripMenuItem { Text = "E&xit" };
menuExit.Click += new EventHandler((a, b) => Application.Exit());
menu.Items.AddRange(new ToolStripMenuItem[] { menuExit });
menu.Items.Add("Exit", _settings.resourceSet.GetObject("Exit") as Image, (a, b) => Application.Exit());

menu.ResumeLayout(false);

return menu;
}
Expand Down

0 comments on commit c8ca524

Please sign in to comment.