Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
467 lines (434 sloc) 32.2 KB
<Type Name="ToolStripDropDownMenu" FullName="System.Windows.Forms.ToolStripDropDownMenu">
<TypeSignature Language="C#" Value="public class ToolStripDropDownMenu : System.Windows.Forms.ToolStripDropDown" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit ToolStripDropDownMenu extends System.Windows.Forms.ToolStripDropDown" />
<TypeSignature Language="DocId" Value="T:System.Windows.Forms.ToolStripDropDownMenu" />
<TypeSignature Language="VB.NET" Value="Public Class ToolStripDropDownMenu&#xA;Inherits ToolStripDropDown" />
<TypeSignature Language="C++ CLI" Value="public ref class ToolStripDropDownMenu : System::Windows::Forms::ToolStripDropDown" />
<TypeSignature Language="F#" Value="type ToolStripDropDownMenu = class&#xA; inherit ToolStripDropDown" />
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Base>
<BaseTypeName>System.Windows.Forms.ToolStripDropDown</BaseTypeName>
</Base>
<Interfaces />
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netcore-3.0">
<AttributeName>System.ComponentModel.Designer("System.Windows.Forms.Design.ToolStripDropDownDesigner, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netcore-3.0">
<AttributeName>System.Runtime.InteropServices.ComVisible(true)</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5">
<AttributeName>System.ComponentModel.Designer("System.Windows.Forms.Design.ToolStripDropDownDesigner, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netcore-3.0">
<AttributeName>System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)</AttributeName>
</Attribute>
</Attributes>
<Docs>
<summary>Provides basic functionality for the <see cref="T:System.Windows.Forms.ContextMenuStrip" /> control. Although <see cref="T:System.Windows.Forms.ToolStripDropDownMenu" /> and <see cref="T:System.Windows.Forms.ToolStripDropDown" /> replace and add functionality to the <see cref="T:System.Windows.Forms.Menu" /> control of previous versions, <see cref="T:System.Windows.Forms.Menu" /> is retained for both backward compatibility and future use if you choose.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
<xref:System.Windows.Forms.ToolStripDropDownMenu> is the base class for <xref:System.Windows.Forms.ContextMenuStrip>, providing necessary painting and layout properties and methods. The properties of this class that you are most likely to use directly are the <xref:System.Windows.Forms.ToolStripDropDownMenu.ShowCheckMargin%2A> and <xref:System.Windows.Forms.ToolStripDropDownMenu.ShowImageMargin%2A> properties, which determine whether the shortcut menu will be able to display a check mark, an image, or both.
## Examples
The following code example demonstrates how to create and initialize a <xref:System.Windows.Forms.ContextMenuStrip> control by setting the check and image margins.
> [!IMPORTANT]
> This code is not a complete sample so it will not compile. For a full code listing, see [How to: Enable Check Margins and Image Margins in ContextMenuStrip Controls](~/docs/framework/winforms/controls/how-to-enable-check-margins-and-image-margins-in-contextmenustrip-controls.md).
[!code-csharp[System.Windows.Forms.ToolStrip.Misc#61](~/samples/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.Misc/CS/Program.cs#61)]
[!code-vb[System.Windows.Forms.ToolStrip.Misc#61](~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.Misc/VB/Program.vb#61)]
]]></format>
</remarks>
<altmember cref="T:System.Windows.Forms.ContextMenuStrip" />
<altmember cref="T:System.Windows.Forms.ToolStripDropDown" />
<related type="Article" href="https://msdn.microsoft.com/library/81d067ed-297c-4dad-90de-1bcac15336ec">ToolStrip Control Overview (Windows Forms)</related>
<related type="Article" href="https://msdn.microsoft.com/library/71df2d18-862e-4701-9ff9-c1fe606f94f2">ToolStrip Control Architecture</related>
<related type="Article" href="https://msdn.microsoft.com/library/e8d61973-7af9-429f-9df5-05a899c15a7b">ToolStrip Technology Summary</related>
<related type="Article" href="https://msdn.microsoft.com/library/eb584e71-59da-4012-aaca-dbe1c7c7a156">How to: Enable Check Margins and Image Margins in ContextMenuStrip Controls</related>
</Docs>
<Members>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public ToolStripDropDownMenu ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.ToolStripDropDownMenu.#ctor" />
<MemberSignature Language="VB.NET" Value="Public Sub New ()" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; ToolStripDropDownMenu();" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters />
<Docs>
<summary>Initializes a new instance of the <see cref="T:System.Windows.Forms.ToolStripDropDownMenu" /> class.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following code example demonstrates how to create and initialize a <xref:System.Windows.Forms.ContextMenuStrip> control. For a full code listing, see [How to: Enable Check Margins and Image Margins in ContextMenuStrip Controls](~/docs/framework/winforms/controls/how-to-enable-check-margins-and-image-margins-in-contextmenustrip-controls.md).
[!code-csharp[System.Windows.Forms.ToolStrip.Misc#62](~/samples/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.Misc/CS/Program.cs#62)]
[!code-vb[System.Windows.Forms.ToolStrip.Misc#62](~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.Misc/VB/Program.vb#62)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="CreateDefaultItem">
<MemberSignature Language="C#" Value="protected internal override System.Windows.Forms.ToolStripItem CreateDefaultItem (string text, System.Drawing.Image image, EventHandler onClick);" />
<MemberSignature Language="ILAsm" Value=".method familyorassemblyhidebysig virtual instance class System.Windows.Forms.ToolStripItem CreateDefaultItem(string text, class System.Drawing.Image image, class System.EventHandler onClick) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.ToolStripDropDownMenu.CreateDefaultItem(System.String,System.Drawing.Image,System.EventHandler)" />
<MemberSignature Language="C++ CLI" Value="protected public:&#xA; override System::Windows::Forms::ToolStripItem ^ CreateDefaultItem(System::String ^ text, System::Drawing::Image ^ image, EventHandler ^ onClick);" />
<MemberSignature Language="F#" Value="override this.CreateDefaultItem : string * System.Drawing.Image * EventHandler -&gt; System.Windows.Forms.ToolStripItem" Usage="toolStripDropDownMenu.CreateDefaultItem (text, image, onClick)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Windows.Forms.ToolStripItem</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="text" Type="System.String" />
<Parameter Name="image" Type="System.Drawing.Image" />
<Parameter Name="onClick" Type="System.EventHandler" />
</Parameters>
<Docs>
<param name="text">The text to use for the <see cref="T:System.Windows.Forms.ToolStripMenuItem" />. If the <paramref name="text" /> parameter is a hyphen (-), this method creates a <see cref="T:System.Windows.Forms.ToolStripSeparator" />.</param>
<param name="image">The <see cref="T:System.Drawing.Image" /> to display on the <see cref="T:System.Windows.Forms.ToolStripMenuItem" />.</param>
<param name="onClick">An event handler that raises the <see cref="E:System.Windows.Forms.ToolStripItem.Click" /> event when the <see cref="T:System.Windows.Forms.ToolStripMenuItem" /> is clicked.</param>
<summary>Creates a default <see cref="T:System.Windows.Forms.ToolStripMenuItem" /> with the specified text, image, and event handler on a new <see cref="T:System.Windows.Forms.ToolStripDropDownMenu" />.</summary>
<returns>A <see cref="T:System.Windows.Forms.ToolStripMenuItem" />, or a <see cref="T:System.Windows.Forms.ToolStripSeparator" /> if the <paramref name="text" /> parameter is a hyphen (-).</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Use the <xref:System.Windows.Forms.ToolStripDropDownMenu.CreateDefaultItem%2A> method to add a <xref:System.Windows.Forms.ToolStripMenuItem> with commonly used characteristics to a <xref:System.Windows.Forms.ToolStripDropDownMenu>.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="DefaultPadding">
<MemberSignature Language="C#" Value="protected override System.Windows.Forms.Padding DefaultPadding { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.Windows.Forms.Padding DefaultPadding" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.ToolStripDropDownMenu.DefaultPadding" />
<MemberSignature Language="VB.NET" Value="Protected Overrides ReadOnly Property DefaultPadding As Padding" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; virtual property System::Windows::Forms::Padding DefaultPadding { System::Windows::Forms::Padding get(); };" />
<MemberSignature Language="F#" Value="member this.DefaultPadding : System.Windows.Forms.Padding" Usage="System.Windows.Forms.ToolStripDropDownMenu.DefaultPadding" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Windows.Forms.Padding</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the internal spacing, in pixels, of the control.</summary>
<value>A <see langword="Padding" /> object representing the spacing.</value>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="DisplayRectangle">
<MemberSignature Language="C#" Value="public override System.Drawing.Rectangle DisplayRectangle { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.Drawing.Rectangle DisplayRectangle" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.ToolStripDropDownMenu.DisplayRectangle" />
<MemberSignature Language="VB.NET" Value="Public Overrides ReadOnly Property DisplayRectangle As Rectangle" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property System::Drawing::Rectangle DisplayRectangle { System::Drawing::Rectangle get(); };" />
<MemberSignature Language="F#" Value="member this.DisplayRectangle : System.Drawing.Rectangle" Usage="System.Windows.Forms.ToolStripDropDownMenu.DisplayRectangle" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Drawing.Rectangle</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the rectangle that represents the display area of the <see cref="T:System.Windows.Forms.ToolStripDropDownMenu" />.</summary>
<value>A <see cref="T:System.Drawing.Rectangle" /> that represents the display area.</value>
<remarks>To be added.</remarks>
<altmember cref="P:System.Windows.Forms.Control.DisplayRectangle" />
</Docs>
</Member>
<Member MemberName="LayoutEngine">
<MemberSignature Language="C#" Value="public override System.Windows.Forms.Layout.LayoutEngine LayoutEngine { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Windows.Forms.Layout.LayoutEngine LayoutEngine" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.ToolStripDropDownMenu.LayoutEngine" />
<MemberSignature Language="VB.NET" Value="Public Overrides ReadOnly Property LayoutEngine As LayoutEngine" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property System::Windows::Forms::Layout::LayoutEngine ^ LayoutEngine { System::Windows::Forms::Layout::LayoutEngine ^ get(); };" />
<MemberSignature Language="F#" Value="member this.LayoutEngine : System.Windows.Forms.Layout.LayoutEngine" Usage="System.Windows.Forms.ToolStripDropDownMenu.LayoutEngine" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Windows.Forms.Layout.LayoutEngine</ReturnType>
</ReturnValue>
<Docs>
<summary>Passes a reference to the cached <see cref="P:System.Windows.Forms.Control.LayoutEngine" /> returned by the layout engine interface.</summary>
<value>A <see cref="T:System.Windows.Forms.Layout.LayoutEngine" /> that represents the cached layout engine returned by the layout engine interface.</value>
<remarks>To be added.</remarks>
<altmember cref="P:System.Windows.Forms.ToolStrip.LayoutEngine" />
</Docs>
</Member>
<Member MemberName="LayoutStyle">
<MemberSignature Language="C#" Value="public System.Windows.Forms.ToolStripLayoutStyle LayoutStyle { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.Windows.Forms.ToolStripLayoutStyle LayoutStyle" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.ToolStripDropDownMenu.LayoutStyle" />
<MemberSignature Language="VB.NET" Value="Public Property LayoutStyle As ToolStripLayoutStyle" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::Windows::Forms::ToolStripLayoutStyle LayoutStyle { System::Windows::Forms::ToolStripLayoutStyle get(); void set(System::Windows::Forms::ToolStripLayoutStyle value); };" />
<MemberSignature Language="F#" Value="member this.LayoutStyle : System.Windows.Forms.ToolStripLayoutStyle with get, set" Usage="System.Windows.Forms.ToolStripDropDownMenu.LayoutStyle" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.DefaultValue(Mono.Cecil.CustomAttributeArgument)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Windows.Forms.ToolStripLayoutStyle</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets a value indicating how the items of <see cref="T:System.Windows.Forms.ContextMenuStrip" /> are displayed.</summary>
<value>One of the <see cref="T:System.Windows.Forms.ToolStripLayoutStyle" /> values. The default is <see cref="F:System.Windows.Forms.ToolStripLayoutStyle.Flow" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
By default, <xref:System.Windows.Forms.ContextMenuStrip> items flow horizontally or vertically as necessary. See the <xref:System.Windows.Forms.ToolStripLayoutStyle> enumeration for the other possibilities.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="MaxItemSize">
<MemberSignature Language="C#" Value="protected internal override System.Drawing.Size MaxItemSize { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.Drawing.Size MaxItemSize" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.ToolStripDropDownMenu.MaxItemSize" />
<MemberSignature Language="VB.NET" Value="Protected Friend Overrides ReadOnly Property MaxItemSize As Size" />
<MemberSignature Language="C++ CLI" Value="protected public:&#xA; virtual property System::Drawing::Size MaxItemSize { System::Drawing::Size get(); };" />
<MemberSignature Language="F#" Value="member this.MaxItemSize : System.Drawing.Size" Usage="System.Windows.Forms.ToolStripDropDownMenu.MaxItemSize" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Drawing.Size</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the maximum height and width, in pixels, of the <see cref="T:System.Windows.Forms.ContextMenuStrip" />.</summary>
<value>A <see langword="Size" /> object representing the height and width of the control, in pixels.</value>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="OnFontChanged">
<MemberSignature Language="C#" Value="protected override void OnFontChanged (EventArgs e);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig virtual instance void OnFontChanged(class System.EventArgs e) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.ToolStripDropDownMenu.OnFontChanged(System.EventArgs)" />
<MemberSignature Language="VB.NET" Value="Protected Overrides Sub OnFontChanged (e As EventArgs)" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; override void OnFontChanged(EventArgs ^ e);" />
<MemberSignature Language="F#" Value="override this.OnFontChanged : EventArgs -&gt; unit" Usage="toolStripDropDownMenu.OnFontChanged e" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="e" Type="System.EventArgs" />
</Parameters>
<Docs>
<param name="e">An <see cref="T:System.EventArgs" /> that contains the event data.</param>
<summary>Raises the <see cref="E:System.Windows.Forms.ToolStripDropDown.FontChanged" /> event.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](~/docs/standard/events/index.md).
The <xref:System.Windows.Forms.ToolStripDropDownMenu.OnFontChanged%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
]]></format>
</remarks>
<block subset="none" type="overrides">
<para>When overriding <see cref="M:System.Windows.Forms.ToolStripDropDownMenu.OnFontChanged(System.EventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.ToolStripDropDownMenu.OnFontChanged(System.EventArgs)" /> method so that registered delegates receive the event.</para>
</block>
</Docs>
</Member>
<Member MemberName="OnLayout">
<MemberSignature Language="C#" Value="protected override void OnLayout (System.Windows.Forms.LayoutEventArgs e);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig virtual instance void OnLayout(class System.Windows.Forms.LayoutEventArgs e) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.ToolStripDropDownMenu.OnLayout(System.Windows.Forms.LayoutEventArgs)" />
<MemberSignature Language="VB.NET" Value="Protected Overrides Sub OnLayout (e As LayoutEventArgs)" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; override void OnLayout(System::Windows::Forms::LayoutEventArgs ^ e);" />
<MemberSignature Language="F#" Value="override this.OnLayout : System.Windows.Forms.LayoutEventArgs -&gt; unit" Usage="toolStripDropDownMenu.OnLayout e" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="e" Type="System.Windows.Forms.LayoutEventArgs" />
</Parameters>
<Docs>
<param name="e">A <see cref="T:System.Windows.Forms.LayoutEventArgs" /> that contains the event data.</param>
<summary>Raises the <see cref="E:System.Windows.Forms.Control.Layout" /> event.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](~/docs/standard/events/index.md).
The <xref:System.Windows.Forms.ToolStripDropDownMenu.OnLayout%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
]]></format>
</remarks>
<block subset="none" type="overrides">
<para>When overriding <see cref="M:System.Windows.Forms.ToolStripDropDownMenu.OnLayout(System.Windows.Forms.LayoutEventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.ToolStripDropDownMenu.OnLayout(System.Windows.Forms.LayoutEventArgs)" /> method so that registered delegates receive the event.</para>
</block>
</Docs>
</Member>
<Member MemberName="OnPaintBackground">
<MemberSignature Language="C#" Value="protected override void OnPaintBackground (System.Windows.Forms.PaintEventArgs e);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig virtual instance void OnPaintBackground(class System.Windows.Forms.PaintEventArgs e) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.ToolStripDropDownMenu.OnPaintBackground(System.Windows.Forms.PaintEventArgs)" />
<MemberSignature Language="VB.NET" Value="Protected Overrides Sub OnPaintBackground (e As PaintEventArgs)" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; override void OnPaintBackground(System::Windows::Forms::PaintEventArgs ^ e);" />
<MemberSignature Language="F#" Value="override this.OnPaintBackground : System.Windows.Forms.PaintEventArgs -&gt; unit" Usage="toolStripDropDownMenu.OnPaintBackground e" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="e" Type="System.Windows.Forms.PaintEventArgs" />
</Parameters>
<Docs>
<param name="e">A <see cref="T:System.Windows.Forms.PaintEventArgs" /> that contains the event data.</param>
<summary>Paints the background of the control.</summary>
<remarks>To be added.</remarks>
<altmember cref="M:System.Windows.Forms.Control.OnPaintBackground(System.Windows.Forms.PaintEventArgs)" />
</Docs>
</Member>
<Member MemberName="SetDisplayedItems">
<MemberSignature Language="C#" Value="protected override void SetDisplayedItems ();" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig virtual instance void SetDisplayedItems() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.ToolStripDropDownMenu.SetDisplayedItems" />
<MemberSignature Language="VB.NET" Value="Protected Overrides Sub SetDisplayedItems ()" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; override void SetDisplayedItems();" />
<MemberSignature Language="F#" Value="override this.SetDisplayedItems : unit -&gt; unit" Usage="toolStripDropDownMenu.SetDisplayedItems " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Resets the collection of displayed and overflow items after a layout is done.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="ShowCheckMargin">
<MemberSignature Language="C#" Value="public bool ShowCheckMargin { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool ShowCheckMargin" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.ToolStripDropDownMenu.ShowCheckMargin" />
<MemberSignature Language="VB.NET" Value="Public Property ShowCheckMargin As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property bool ShowCheckMargin { bool get(); void set(bool value); };" />
<MemberSignature Language="F#" Value="member this.ShowCheckMargin : bool with get, set" Usage="System.Windows.Forms.ToolStripDropDownMenu.ShowCheckMargin" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.DefaultValue(false)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets a value indicating whether space for a check mark is shown on the left edge of the <see cref="T:System.Windows.Forms.ToolStripMenuItem" />.</summary>
<value>
<see langword="true" /> if the check margin is shown; otherwise, <see langword="false" />. The default is <see langword="false" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Set the <xref:System.Windows.Forms.ToolStripDropDownMenu.ShowCheckMargin%2A> property to `true` to display a check mark when the user chooses the <xref:System.Windows.Forms.ToolStripMenuItem>.
## Examples
The following code example demonstrates how to create and initialize a <xref:System.Windows.Forms.ContextMenuStrip> control by setting the check and image margins. For a full code listing, see [How to: Enable Check Margins and Image Margins in ContextMenuStrip Controls](~/docs/framework/winforms/controls/how-to-enable-check-margins-and-image-margins-in-contextmenustrip-controls.md).
[!code-csharp[System.Windows.Forms.ToolStrip.Misc#61](~/samples/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.Misc/CS/Program.cs#61)]
[!code-vb[System.Windows.Forms.ToolStrip.Misc#61](~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.Misc/VB/Program.vb#61)]
]]></format>
</remarks>
<altmember cref="P:System.Windows.Forms.ToolStripDropDownMenu.ShowImageMargin" />
<related type="Article" href="https://msdn.microsoft.com/library/eb584e71-59da-4012-aaca-dbe1c7c7a156">How to: Enable Check Margins and Image Margins in ContextMenuStrip Controls</related>
</Docs>
</Member>
<Member MemberName="ShowImageMargin">
<MemberSignature Language="C#" Value="public bool ShowImageMargin { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool ShowImageMargin" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.ToolStripDropDownMenu.ShowImageMargin" />
<MemberSignature Language="VB.NET" Value="Public Property ShowImageMargin As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property bool ShowImageMargin { bool get(); void set(bool value); };" />
<MemberSignature Language="F#" Value="member this.ShowImageMargin : bool with get, set" Usage="System.Windows.Forms.ToolStripDropDownMenu.ShowImageMargin" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.DefaultValue(true)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets a value indicating whether space for an image is shown on the left edge of the <see cref="T:System.Windows.Forms.ToolStripMenuItem" />.</summary>
<value>
<see langword="true" /> if the image margin is shown; otherwise, <see langword="false" />. The default is <see langword="true" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Set the <xref:System.Windows.Forms.ToolStripDropDownMenu.ShowImageMargin%2A> property to `true` to display a graphic image with the <xref:System.Windows.Forms.ToolStripMenuItem>.
## Examples
The following code example demonstrates how to create and initialize a <xref:System.Windows.Forms.ContextMenuStrip> control by setting the check and image margins. For a full code listing, see [How to: Enable Check Margins and Image Margins in ContextMenuStrip Controls](~/docs/framework/winforms/controls/how-to-enable-check-margins-and-image-margins-in-contextmenustrip-controls.md).
[!code-csharp[System.Windows.Forms.ToolStrip.Misc#61](~/samples/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.Misc/CS/Program.cs#61)]
[!code-vb[System.Windows.Forms.ToolStrip.Misc#61](~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.Misc/VB/Program.vb#61)]
]]></format>
</remarks>
<altmember cref="P:System.Windows.Forms.ToolStripDropDownMenu.ShowCheckMargin" />
<related type="Article" href="https://msdn.microsoft.com/library/eb584e71-59da-4012-aaca-dbe1c7c7a156">How to: Enable Check Margins and Image Margins in ContextMenuStrip Controls</related>
</Docs>
</Member>
</Members>
</Type>
You can’t perform that action at this time.