I have created a Table layout in windows forms as shown in figure, i have added a right mouse button click Menu to my table,
i wnt to add submenu items to following menuitems such as
When i click add device
it should show subitems such as sounder
, MCP
, strobe
etc
When i click fault
it should show subitems such as open circuit fault
, sounder fault
, `short circuit fault' so on
This is how i created menuitems
ContextMenu m = new ContextMenu();
MenuItem addDevice = new MenuItem("Add Device");
MenuItem deleteDevice = new MenuItem("delete Device");
MenuItem fire = new MenuItem("Fire");
MenuItem fault = new MenuItem("Fault");
MenuItem suppress = new MenuItem("Suppress");
m.MenuItems.AddRange(new MenuItem[] { addDevice, deleteDevice, fire, fault,suppress});
tableLayout.ContextMenu = m;
m.Show((Control)(sender), e.Location);
The below is my form and table layout