There is a weird behaviour in the context menu.
PROBLEM:
In windows forms application
add a context menu.
add a menuitem called samp
add events Select and PopUp for menuitem samp.
In Select event of menuitem samp
add a new menuitem say "Test1"
When you run the application and when your mouse is over the menuitem samp then TEST1 is displayed as the child item.
Now In select event of menuitem samp
add a new menuitem say "Test1"
add a new menuitem say "Test2"
When you run the application on mouse over of the menuitem samp no menuitem is displayed.
SOLUTION:
Could someone help me on how to solve this problem
I am able to add menuitems to samp in the form load event and also context menu onpopup event.
Thanks in Advance
Regards
Aravind Biran

CONTEXT MENU WEIRD BEHAVIOUR
Gwen T
I don't understand why you would want to build the menu on the fly anyway. This seems to be more difficult than it is worth. Most apps dynamically generate the context menu and all its children at one time and then let Windows handle the rest. If you are dealing with a really large context menu then I'd say that you might want to reconsider your approach because context menus shouldn't be that big or complex as it sort of defeats the purpose.
Therefore my suggestion is to build the context menu and its children at one time. This can occur either when a certain event occurs (such as when a node is selected in a tree) or prior to displaying the context menu itself. Attempting to dynamically build a context menu seems a little too complex for little gain but if you want to do that then you should build your child menus in the Popup event of the parent.
Michael Taylor - 11/21/05