We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Main Menu

Thread ID:





877 Aug 27,2002 08:41 PM Aug 28,2002 05:14 PM Windows Forms 2
Tags: FAQ
Administrator [Syncfusion]
Asked On August 27, 2002 08:41 PM

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.

Clay Burch [Syncfusion]
Replied On August 28, 2002 04: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

Administrator [Syncfusion]
Replied On August 28, 2002 05: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?


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.