WinForm menu of ContextMenuStrip

Source: Internet
Author: User

ContextMenuStrip is actually the context menu, which is the menu that comes out after you right-click a form or control.

Drag one out of the toolbar and put it on the window.

Then make a series of settings, the setting method is the same as the previous MenuStrip, or set from the Items collection, of course, you can also enter the menu item directly above the ContextMenuStrip, and then double-click a menu item to switch to code view for logic encoding. With MenuStrip, if it is a multi-level menu, you can continue to set the collection in the DropDownItems of a single item. Such as

Context menu well, from where to see it Nikki, hehe, this problem is good, the context menu must depend on a form or control, such as I put a spllitercontainer in the form, The context menu is then bound to the Spllitercontainer Panel2. Select Panel2, set on Panel2 properties, stickers

Select the context menu on the Pannel2 's ContextMenuStrip property so that the context menu is bound to the control. Ah, post it to

Right click on the panel2 to come out Oh, click on other places mo useful OH

As for the context menu associated with the data, for example, with a row of data inside the DataGridView, this is described in the following DataGridView.

WinForm menu of ContextMenuStrip

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.