Hi,
I have written a Taskbar Windows Form which has a Menu of Items
Menu Item
Menu Item
Menu Item - Submenu -Item1
- Submenu -Item2
I want to add a level off the submenu, but I just cant get it to work
Menu Item
Menu Item
Menu Item - Submenu -Item1
- Submenu -Item2 - SubMenu - Item1
My code is
Any advise would be great
Cheers
I have written a Taskbar Windows Form which has a Menu of Items
Menu Item
Menu Item
Menu Item - Submenu -Item1
- Submenu -Item2
I want to add a level off the submenu, but I just cant get it to work
Menu Item
Menu Item
Menu Item - Submenu -Item1
- Submenu -Item2 - SubMenu - Item1
My code is
C#:
MenuItem Spacer3 = (new MenuItem("-"));
MenuItem UpDateAsset = (new MenuItem("Location", new EventHandler(this.ShowMyLocation)));
MenuItem Spacer2 = (new MenuItem("-"));
MenuItem MyComputer = new MenuItem("Config", new EventHandler(this.ShowConfig));
MenuItem Spacer4 = (new MenuItem("-"));
MenuItem MenuMessage = new MenuItem("Toast", new EventHandler(this.ShowToast));
MenuItem Spacer = new MenuItem("-");
MenuItem AdminItem = new MenuItem("Admin");
AdminItem.MenuItems.Add(new MenuItem("Refresh", new EventHandler(this.RefreshAll)));
AdminItem.MenuItems.Add(new MenuItem("Update", new EventHandler(this.UpdateAll)));
AdminItem.MenuItems.Add(new MenuItem("Exit", new EventHandler(this.Exit)));
MenuItem ToolsItem = new MenuItem("User Tools");
ToolsItem.MenuItems.Add(new MenuItem("Software", new EventHandler(this.ShowSoftware)));
ToolsItem.MenuItems.Add(new MenuItem("-"));
ToolsItem.MenuItems.Add(new MenuItem("Map", new EventHandler(this.ShowMapDrive)));
ToolsItem.MenuItems.Add(new MenuItem("-"));
//This is the extra Sub Menu I am trying to add
var Setss = new MenuItem();
Setss.Name = xmlNode.SelectSingleNode("Name").InnerText;
Setss.Text = xmlNode.SelectSingleNode("Name").InnerText;
Setss.Click += Menu_Click;
ToolsItem.MenuItems.Add(0, Windset);
//To here
this.notifyIcon.ContextMenu = new ContextMenu(new MenuItem[] { Spacer3, UpDateAsset, Spacer2, MenuMessage, Spacer4, MyComputer, Spacer, ToolsItem, Spacer, AdminItem });
Any advise would be great
Cheers