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.
CBClay Burch Syncfusion Team August 28, 2002 03:24 AM
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
ADAdministrator Syncfusion Team August 28, 2002 04:14 PM
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?