C# для управления menustrip - создание функции, возвращающей значение toolstripmenu
create a function that returns Activity
Что я уже пробовал:
private void MenuActivity() { //menu ToolStripMenuItem Activity = new ToolStripMenuItem("&Activity", null); //submenu //------------------ ToolStripMenuItem New1 = new ToolStripMenuItem("A", null, Item_Click); ToolStripMenuItem New2 = new ToolStripMenuItem("B", null, Item_Click); ToolStripMenuItem New3 = new ToolStripMenuItem("C", null, Item_Click); ToolStripMenuItem New4 = new ToolStripMenuItem("D", null, Item_Click); Activity.DropDownItems.Add(New1); Activity.DropDownItems.Add(New2); Activity.DropDownItems.Add(New3); Activity.DropDownItems.Add(New4); strip.Items.Add(Activity); } private <objecttypemenu> MnuActivity GetActivity() { //menu ToolStripMenuItem Activity = new ToolStripMenuItem("&Activity", null); ............ return MnuActivity; }