* Merge winforms framework content to working branch (#14) * Breadcrumb / TOC / Move net5 to net folder (#15) * change path from net5 to net * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Add .net 5 winforms placeholder article (#16) * added some metadata and adjusted net5 placeholder * corrections * corrections * corrections * Test1 * Swapping landing page vs concept * fix links * Fix links * Fix desc
2.1 KiB
title, ms.date, dev_langs, helpviewer_keywords, ms.assetid
| title | ms.date | dev_langs | helpviewer_keywords | ms.assetid | |||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| How to: Enable Check Margins and Image Margins in ContextMenuStrip Controls | 03/30/2017 |
|
|
eb584e71-59da-4012-aaca-dbe1c7c7a156 |
How to: Enable Check Margins and Image Margins in ContextMenuStrip Controls
You can customize the xref:System.Windows.Forms.ToolStripMenuItem objects in your xref:System.Windows.Forms.MenuStrip control with check marks and custom images.
Example
The following code example demonstrates how to create menu items that have check marks and custom images.
[!code-csharpSystem.Windows.Forms.ToolStrip.Misc#1]
[!code-vbSystem.Windows.Forms.ToolStrip.Misc#1]
[!code-csharpSystem.Windows.Forms.ToolStrip.Misc#60]
[!code-vbSystem.Windows.Forms.ToolStrip.Misc#60]
Set the xref:System.Windows.Forms.ToolStripDropDownMenu.ShowCheckMargin%2A?displayProperty=nameWithType and xref:System.Windows.Forms.ToolStripDropDownMenu.ShowImageMargin%2A?displayProperty=nameWithType properties to specify when check marks and custom images appear in your menu items.
Compiling the Code
This example requires:
- References to the System.Design, System.Drawing, and System.Windows.Forms assemblies.