Clear MainMenu items

B

Benson

I have a MainMenu (MenuStrip) which will be loaded (dynamic by codes) after
the program Login form. The first time run is ok. But when I close the
MainMenu and go back to Login form, and then go to MainMenu again, the menu
items didn't clear by MainMenu.Items.Clear().
That is:
1. Login -> MainMenu.items.clear() -> MainMenu (dynamic add menu items by
code) => OK
2. Login -> MainMenu.items.clear() -> MainMenu (dynamic add menu items by
code) -> Login ->
MainMenu.items.clear() -> MainMenu (dynamic add menu items by code) =>
menu items are double loaded???

Any hints?
Benson
VB2005
 
C

ClayB

You might try placing a stop in the code where you add the menu items
just to check whether this code is being executed twice the second
time around for some reason.

====================
Clay Burch
Syncfusion, Inc.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top