Skip to content

Instantly share code, notes, and snippets.

@groundwater
Created February 17, 2021 23:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save groundwater/248a6b1386f1dc999f1997d4afbae947 to your computer and use it in GitHub Desktop.
Save groundwater/248a6b1386f1dc999f1997d4afbae947 to your computer and use it in GitHub Desktop.
using System;
using System.Windows.Forms;
namespace WindowsFormsApp1
{
static class Program
{
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form2());
}
}
}
public class Form2 : Form
{
public Form2()
{
this.IsMdiContainer = true;
MenuStrip ms = new MenuStrip();
ToolStripMenuItem windowMenu = new ToolStripMenuItem("&Test&");
windowMenu.DropDownItems.Add(new ToolStripMenuItem("&", null, new EventHandler(nothing)));
windowMenu.DropDownItems.Add(new ToolStripMenuItem("&test", null, new EventHandler(nothing)));
windowMenu.DropDownItems.Add(new ToolStripMenuItem("test&", null, new EventHandler(nothing)));
ms.Items.Add(windowMenu);
this.MainMenuStrip = ms;
this.Controls.Add(ms);
}
void nothing(object sender, EventArgs e)
{
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment