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. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Main Menu

Thread ID:





877 Aug 28,2002 12:41 AM UTC Aug 28,2002 09:14 PM UTC WinForms 2
Tags: FAQ
Administrator [Syncfusion]
Asked On August 28, 2002 12:41 AM UTC

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 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

Administrator [Syncfusion]
Replied On 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?


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon

Live Chat Icon For mobile
Live Chat Icon