My program has a notifyicon in the system tray, and this notifyicon has a context menu called mnuContextMenu. The context menu has a number of menuitems, some of which have submenus of their own. My program has procedures to add and remove menuitems and submenuitems from mnuContextMenu. Everything seems to work fine. However, when I add a new item to the submenu of one of the main items in mnuContextMenu, the main item in question will no longer expand and show the submenu, even though it still has that little arrow on it to indicate that there is a submenu.
In otherwords, lets say the starting items for mnuContextMenu are one two and three. And lets say two has a submenu consiting of aaaa bbbb cccc and dddd. My program tries to add a new subitem with text eeee to menuitem two the problem is that after that happens, whenever I hover the mouse over item two it will no longer expand to show me the subitems aaaa through eeee even though two still has the arrow indicating that it has a submenu. Furthermore, when I check via the command window, I can see that menuitem two is still considered a Parent, and its menuitems.count has in fact increased.
The code that I used to do this, I have a variable called curMain (declared as a menuitem) which, at the point in question, is set to represent one of the menuitems in mnuContextMenu (in the hypothetical above, curMain points to the menuitem that has two as the text (curMain.text = two). So my code to add the subitem to curMain is: curMain.MenuItems.add(inp), where inp is a string= eeee. Once this instruction is executed, mnuContextMenu will no longer expand to show the submenu under two although all the other submenus still work.
I hope Ive explained this well. Any help would be greatly appreciated! Thanks.
In otherwords, lets say the starting items for mnuContextMenu are one two and three. And lets say two has a submenu consiting of aaaa bbbb cccc and dddd. My program tries to add a new subitem with text eeee to menuitem two the problem is that after that happens, whenever I hover the mouse over item two it will no longer expand to show me the subitems aaaa through eeee even though two still has the arrow indicating that it has a submenu. Furthermore, when I check via the command window, I can see that menuitem two is still considered a Parent, and its menuitems.count has in fact increased.
The code that I used to do this, I have a variable called curMain (declared as a menuitem) which, at the point in question, is set to represent one of the menuitems in mnuContextMenu (in the hypothetical above, curMain points to the menuitem that has two as the text (curMain.text = two). So my code to add the subitem to curMain is: curMain.MenuItems.add(inp), where inp is a string= eeee. Once this instruction is executed, mnuContextMenu will no longer expand to show the submenu under two although all the other submenus still work.
I hope Ive explained this well. Any help would be greatly appreciated! Thanks.