MainMenu Control for VB.net

Source: Internet
Author: User

The MainMenu (Main menu) control is the "menu editor" used by vb.net to replace the previous version of Visual Basic. The MainMenu control has a great advantage over the menu editor because it makes it easier for the application to use the entire menu as a control's "identity," and you can make multiple uses of different forms without having to redesign the menus for each form. The icon for the MainMenu control in the toolbox is as shown in the figure:

1. Add MainMenu controls at design time
Adding a MainMenu control is the same as adding other controls (double-clicking or dragging), but the MainMenu control itself does not exist on the form, but rather in the component tray below the form, as shown in the following illustration:

None of the controls here are present in the form, but its methods, procedures, properties affect the form and other controls on it, such as the timer control, the Helpprovide (Help provided) control, and so on.
2. Make Menu
Click the MainMenu control in the component tray, and then in the top left of the form, click Type here, change the title of the menu, as shown in the following illustration:

Right-click any of the top menu and select "Edit Names" (change name) from the pop-up menu, as shown in the following illustration:

When you click the submenu again, you can change the name of the menu. Click "Edit Names" for the third time to restore the normal menu editing status.
3. Menu click event
The most commonly used event in a menu is the click event, which, in general, always corresponds to the Click event of the button in the toolbar.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.