Main Menu

I have a main menu with one menu item named Customer. How do I add a "check" beside the Customer menu item once the user clicks the Customer item and the Customer form opens. Once the user closes the Customer form, i want the check beside the menu item to disappear. I tried adding this code in the Customer_Load: dim frmMain as new frmMain() frmMain.MainMenu.MenuItems(0).checked = true but it doesn't work.

2 Replies

CB Clay Burch Syncfusion Team August 28, 2002 08:24 AM UTC

Here you are creating a *new* frmMain. You want to get the one that already exists. Assuming that the parent class of this customer form is derived from Form, you might try this code. dim f as Form = Me.Parent f.MainMenu.MenuItems(0).checked = true


AD Administrator Syncfusion Team August 28, 2002 09:14 PM UTC

thanks. i will try that. i'm really confused with the *new* instantiation of objects!! because if i don't use the *new* keyword to declare my object, i get an error. How do i pass a reference of form1 to form2 without creating a *new* form1 in form2?

Loader.
Up arrow icon