Skip to content

Latest commit

 

History

History
38 lines (29 loc) · 2.13 KB

how-to-configure-contextmenustrip-check-margins-and-image-margins.md

File metadata and controls

38 lines (29 loc) · 2.13 KB
title ms.date dev_langs helpviewer_keywords ms.assetid description
How to: Configure ContextMenuStrip Check Margins and Image Margins
03/30/2017
csharp
vb
context menus [Windows Forms], configuring check and image margins
ContextMenuStrips [Windows Forms], configuring check and image margins
margins [Windows Forms], setting check and image in Windows Forms ContextMenuStrips
3391c4c2-0c9e-4aa4-9492-13ff7644bdf2
Learn how to configure ContextMenuStrip check margins and image margins by setting the properties in various combinations.

How to: Configure ContextMenuStrip Check Margins and Image Margins

You can customize a xref:System.Windows.Forms.ContextMenuStrip by setting the xref:System.Windows.Forms.ToolStripDropDownMenu.ShowImageMargin%2A and xref:System.Windows.Forms.ToolStripDropDownMenu.ShowCheckMargin%2A properties in various combinations.

Example

The following code example demonstrates how to set and customize the xref:System.Windows.Forms.ContextMenuStrip check and image margins.

[!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]

Compiling the Code

This example requires:

  • References to the System.Design, System.Drawing, and System.Windows.Forms assemblies.

See also