G
Guest
Hi
I have the following problem
I'm trying to create a dynamic ContextMenu (used by a NotifyIcon), but when I repopulate the submenus the submenus won't show. the little arrow is there - indicating that there are submenues available - but they won't popup
On the ContextMenu objects Popup eventhandler i have the routine that populates/repopulates the submenus
The submenues is populated like this
menuConnect.MenuItems.Clear()
menuDisconnect.MenuItems.Clear()
string[] names = reg.GetSubKeyNames()
for (int i=0; i<names.Length; i++)
if (names.ToLower().Equals("startup") || names.ToLower().Equals("")) continue
menuConnect.MenuItems.Add(new MenuItem(names, new EventHandler(menuConnect_Click)))
menuDisconnect.MenuItems.Add(new MenuItem(names, new EventHandler(menuDisconnect_Click)))
where menuContent and menuDisconnect are menuitems added to the contextMenu in design-time
Any help is appriciated. I've run out of ideas on how to solve this
The menu "looks" like this
Exi
Setting
------ (break
Connec
- Submenu to Connect her
Disconnec
- Submenu to Disconnect her
// Fredrik
I have the following problem
I'm trying to create a dynamic ContextMenu (used by a NotifyIcon), but when I repopulate the submenus the submenus won't show. the little arrow is there - indicating that there are submenues available - but they won't popup
On the ContextMenu objects Popup eventhandler i have the routine that populates/repopulates the submenus
The submenues is populated like this
menuConnect.MenuItems.Clear()
menuDisconnect.MenuItems.Clear()
string[] names = reg.GetSubKeyNames()
for (int i=0; i<names.Length; i++)
if (names.ToLower().Equals("startup") || names.ToLower().Equals("")) continue
menuConnect.MenuItems.Add(new MenuItem(names, new EventHandler(menuConnect_Click)))
menuDisconnect.MenuItems.Add(new MenuItem(names, new EventHandler(menuDisconnect_Click)))
where menuContent and menuDisconnect are menuitems added to the contextMenu in design-time
Any help is appriciated. I've run out of ideas on how to solve this
The menu "looks" like this
Exi
Setting
------ (break
Connec
- Submenu to Connect her
Disconnec
- Submenu to Disconnect her
// Fredrik