Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
2213 lines (2072 sloc) 155 KB
<Type Name="Label" FullName="System.Windows.Forms.Label">
<TypeSignature Language="C#" Value="public class Label : System.Windows.Forms.Control, System.Windows.Forms.Automation.IAutomationLiveRegion" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit Label extends System.Windows.Forms.Control implements class System.Windows.Forms.Automation.IAutomationLiveRegion" />
<TypeSignature Language="DocId" Value="T:System.Windows.Forms.Label" />
<TypeSignature Language="VB.NET" Value="Public Class Label&#xA;Inherits Control&#xA;Implements IAutomationLiveRegion" />
<TypeSignature Language="C++ CLI" Value="public ref class Label : System::Windows::Forms::Control, System::Windows::Forms::Automation::IAutomationLiveRegion" />
<TypeSignature Language="F#" Value="type Label = class&#xA; inherit Control&#xA; interface IAutomationLiveRegion" />
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Base>
<BaseTypeName>System.Windows.Forms.Control</BaseTypeName>
</Base>
<Interfaces>
<Interface>
<InterfaceName>System.Windows.Forms.Automation.IAutomationLiveRegion</InterfaceName>
</Interface>
</Interfaces>
<Attributes>
<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.ComponentModel.DefaultBindingProperty("Text")</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.DefaultProperty("Text")</AttributeName>
</Attribute>
<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.LabelDesigner, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")</AttributeName>
</Attribute>
<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.ToolboxItem("System.Windows.Forms.Design.AutoSizeToolboxItem,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-1.1">
<AttributeName>System.ComponentModel.Designer("System.Windows.Forms.Design.LabelDesigner, System.Design, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5">
<AttributeName>System.ComponentModel.Designer("System.Windows.Forms.Design.LabelDesigner, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5">
<AttributeName>System.ComponentModel.ToolboxItem("System.Windows.Forms.Design.AutoSizeToolboxItem,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>Represents a standard Windows label.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
<xref:System.Windows.Forms.Label> controls are typically used to provide descriptive text for a control. For example, you can use a <xref:System.Windows.Forms.Label> to add descriptive text for a <xref:System.Windows.Forms.TextBox> control to inform the user about the type of data expected in the control. <xref:System.Windows.Forms.Label> controls can also be used to add descriptive text to a <xref:System.Windows.Forms.Form> to provide the user with helpful information. For example, you can add a <xref:System.Windows.Forms.Label> to the top of a <xref:System.Windows.Forms.Form> that provides instructions to the user on how to input data in the controls on the form. <xref:System.Windows.Forms.Label> controls can be also used to display run time information on the status of an application. For example, you can add a <xref:System.Windows.Forms.Label> control to a form to display the status of each file as a list of files is processed.
A <xref:System.Windows.Forms.Label> participates in the tab order of a form, but does not receive focus (the next control in the tab order receives focus). For example, if the <xref:System.Windows.Forms.Label.UseMnemonic%2A> property is set to `true`, and a mnemonic character - the first character after an ampersand (&) - is specified in the <xref:System.Windows.Forms.Control.Text%2A> property of the control, when a user presses ALT+ the mnemonic key, focus moves to the next control in the tab order. This feature provides keyboard navigation for a form. In addition to displaying text, the <xref:System.Windows.Forms.Label> control can also display an image using the <xref:System.Windows.Forms.Label.Image%2A> property, or a combination of the <xref:System.Windows.Forms.Label.ImageIndex%2A> and <xref:System.Windows.Forms.Label.ImageList%2A> properties.
> [!NOTE]
> A <xref:System.Windows.Forms.Label> can be made transparent by setting its <xref:System.Windows.Forms.Control.BackColor%2A> property to `Color.Transparent`. When you use a transparent label, use only the current device coordinate system to draw on the container, or the <xref:System.Windows.Forms.Label> background might paint improperly.
## Examples
The following code example demonstrates how to create a <xref:System.Windows.Forms.Label> control that has a three-dimensional border and contains an image. The image is displayed using the <xref:System.Windows.Forms.Label.ImageList%2A> and <xref:System.Windows.Forms.Label.ImageIndex%2A> properties. The control also has a caption with a mnemonic character specified. The example code uses the <xref:System.Windows.Forms.Label.PreferredHeight%2A> and <xref:System.Windows.Forms.Label.PreferredWidth%2A> properties to properly size the <xref:System.Windows.Forms.Label> control. This example requires that an <xref:System.Windows.Forms.Label.ImageList%2A> has been created and named imageList1 and that it has loaded two images. The example also requires that the code is within a form that has the <xref:System.Drawing> namespace added to its code.
[!code-cpp[Classic Label Example#1](~/samples/snippets/cpp/VS_Snippets_Winforms/Classic Label Example/CPP/source.cpp#1)]
[!code-csharp[Classic Label Example#1](~/samples/snippets/csharp/VS_Snippets_Winforms/Classic Label Example/CS/source.cs#1)]
[!code-vb[Classic Label Example#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/Classic Label Example/VB/source.vb#1)]
]]></format>
</remarks>
<altmember cref="T:System.Windows.Forms.Control" />
<altmember cref="T:System.Windows.Forms.TextBox" />
</Docs>
<Members>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public Label ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.Label.#ctor" />
<MemberSignature Language="VB.NET" Value="Public Sub New ()" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; Label();" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<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.Label" /> class.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
By default, a label is displayed with its <xref:System.Windows.Forms.Label.AutoSize%2A> property set to `false` and with its <xref:System.Windows.Forms.Label.BorderStyle%2A> property set to `BorderStyle.None`.
## Examples
The following code example demonstrates how to create a <xref:System.Windows.Forms.Label> control that has a three-dimensional border and an image displayed using the <xref:System.Windows.Forms.Label.ImageList%2A> and <xref:System.Windows.Forms.Label.ImageIndex%2A> properties. The control also has a caption with a mnemonic character specified. The example code uses the <xref:System.Windows.Forms.Label.PreferredHeight%2A> and <xref:System.Windows.Forms.Label.PreferredWidth%2A> properties to properly size the <xref:System.Windows.Forms.Label> control on the form on which it is displayed. This example requires that an <xref:System.Windows.Forms.ImageList> has been created and named imageList1 and that it has loaded two images. The example also requires that the code is within a form that has the <xref:System.Drawing?displayProperty=nameWithType> namespace added to its code.
[!code-cpp[Classic Label Example#1](~/samples/snippets/cpp/VS_Snippets_Winforms/Classic Label Example/CPP/source.cpp#1)]
[!code-csharp[Classic Label Example#1](~/samples/snippets/csharp/VS_Snippets_Winforms/Classic Label Example/CS/source.cs#1)]
[!code-vb[Classic Label Example#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/Classic Label Example/VB/source.vb#1)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="AutoEllipsis">
<MemberSignature Language="C#" Value="public bool AutoEllipsis { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool AutoEllipsis" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.Label.AutoEllipsis" />
<MemberSignature Language="VB.NET" Value="Public Property AutoEllipsis As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property bool AutoEllipsis { bool get(); void set(bool value); };" />
<MemberSignature Language="F#" Value="member this.AutoEllipsis : bool with get, set" Usage="System.Windows.Forms.Label.AutoEllipsis" />
<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-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.ComponentModel.Browsable(true)</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.ComponentModel.DefaultValue(false)</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.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Always)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets a value indicating whether the ellipsis character (...) appears at the right edge of the <see cref="T:System.Windows.Forms.Label" />, denoting that the <see cref="T:System.Windows.Forms.Label" /> text extends beyond the specified length of the <see cref="T:System.Windows.Forms.Label" />.</summary>
<value>
<see langword="true" /> if the additional label text is to be indicated by an ellipsis; otherwise, <see langword="false" />. The default is <see langword="false" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Set <xref:System.Windows.Forms.Label.AutoEllipsis%2A> to `true` to display text that extends beyond the width of the <xref:System.Windows.Forms.Label> when the user passes over the control with the mouse. If <xref:System.Windows.Forms.Label.AutoSize%2A> is `true`, the label will grow to fit the text and an ellipsis will not appear.
> [!IMPORTANT]
> If the font is taller than the height of the <xref:System.Windows.Forms.Label> and <xref:System.Windows.Forms.Label.AutoEllipsis%2A> is `true`, you must set <xref:System.Windows.Forms.Label.AutoSize%2A> to `false` for text to be drawn.
]]></format>
</remarks>
<altmember cref="P:System.Windows.Forms.Label.AutoSize" />
</Docs>
</Member>
<Member MemberName="AutoSize">
<MemberSignature Language="C#" Value="public override bool AutoSize { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool AutoSize" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.Label.AutoSize" />
<MemberSignature Language="VB.NET" Value="Public Overrides Property AutoSize As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property bool AutoSize { bool get(); void set(bool value); };" />
<MemberSignature Language="F#" Value="member this.AutoSize : bool with get, set" Usage="System.Windows.Forms.Label.AutoSize" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<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.ComponentModel.Browsable(true)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.DefaultValue(false)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.Localizable(true)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.RefreshProperties(System.ComponentModel.RefreshProperties.All)</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.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Visible)</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.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Always)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets a value indicating whether the control is automatically resized to display its entire contents.</summary>
<value>
<see langword="true" /> if the control adjusts its width to closely fit its contents; otherwise, <see langword="false" />.
<block subset="none" type="note"><para>
When added to a form using the designer, the default value is <see langword="true" />. When instantiated from code, the default value is <see langword="false" />.
</para></block></value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
When this property is set to `true`, the <xref:System.Windows.Forms.Label> adjusts its width to display its entire contents. This property is typically set to `true` when you use a <xref:System.Windows.Forms.Label> control to display various lengths of text, such as the status of an application process. You can also use this property when the application will display text in various languages, and the size of the text might increase or decrease based on the language settings in Windows.
> [!IMPORTANT]
> If the font is taller than the height of the <xref:System.Windows.Forms.Label> and <xref:System.Windows.Forms.Label.AutoEllipsis%2A> is `true`, you must set <xref:System.Windows.Forms.Label.AutoSize%2A> to `false` for text to be drawn.
## Examples
The following code example demonstrates the <xref:System.Windows.Forms.Label.AutoSize%2A> property. To run this example, paste the following code in a form and call the `InitializeLabel` method from the form's constructor or `Load` method.
[!code-cpp[System.Windows.Forms.LabelAutoSize#1](~/samples/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.LabelAutoSize/CPP/form1.cpp#1)]
[!code-csharp[System.Windows.Forms.LabelAutoSize#1](~/samples/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.LabelAutoSize/CS/form1.cs#1)]
[!code-vb[System.Windows.Forms.LabelAutoSize#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.LabelAutoSize/VB/form1.vb#1)]
]]></format>
</remarks>
<altmember cref="P:System.Windows.Forms.Control.Text" />
<altmember cref="P:System.Windows.Forms.Label.PreferredHeight" />
<altmember cref="P:System.Windows.Forms.Label.PreferredWidth" />
<altmember cref="P:System.Windows.Forms.Label.AutoEllipsis" />
</Docs>
</Member>
<Member MemberName="AutoSizeChanged">
<MemberSignature Language="C#" Value="public event EventHandler AutoSizeChanged;" />
<MemberSignature Language="ILAsm" Value=".event class System.EventHandler AutoSizeChanged" />
<MemberSignature Language="DocId" Value="E:System.Windows.Forms.Label.AutoSizeChanged" />
<MemberSignature Language="VB.NET" Value="Public Custom Event AutoSizeChanged As EventHandler " />
<MemberSignature Language="C++ CLI" Value="public:&#xA; event EventHandler ^ AutoSizeChanged;" />
<MemberSignature Language="F#" Value="member this.AutoSizeChanged : EventHandler " Usage="member this.AutoSizeChanged : System.EventHandler " />
<MemberType>Event</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<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.ComponentModel.Browsable(true)</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.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Always)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.EventHandler</ReturnType>
</ReturnValue>
<Docs>
<summary>Occurs when the value of the <see cref="P:System.Windows.Forms.Label.AutoSize" /> property changes.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
For more information about handling events, see [Handling and Raising Events](~/docs/standard/events/index.md).
## Examples
The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.Label.AutoSizeChanged> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>.
To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.Label> named Label1. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.Label.AutoSizeChanged> event.
[!code-csharp[System.Windows.Forms.EventExamples#458](~/samples/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/CS/EventExamples.cs#458)]
[!code-vb[System.Windows.Forms.EventExamples#458](~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb#458)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="BackgroundImage">
<MemberSignature Language="C#" Value="public override System.Drawing.Image BackgroundImage { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Drawing.Image BackgroundImage" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.Label.BackgroundImage" />
<MemberSignature Language="VB.NET" Value="Public Overrides Property BackgroundImage As Image" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property System::Drawing::Image ^ BackgroundImage { System::Drawing::Image ^ get(); void set(System::Drawing::Image ^ value); };" />
<MemberSignature Language="F#" Value="member this.BackgroundImage : System.Drawing.Image with get, set" Usage="System.Windows.Forms.Label.BackgroundImage" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.Browsable(false)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Drawing.Image</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the image rendered on the background of the control.</summary>
<value>An <see cref="T:System.Drawing.Image" /> that represents the background image of the control. The default is <see langword="null" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This property is not relevant for this class.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="BackgroundImageChanged">
<MemberSignature Language="C#" Value="public event EventHandler BackgroundImageChanged;" />
<MemberSignature Language="ILAsm" Value=".event class System.EventHandler BackgroundImageChanged" />
<MemberSignature Language="DocId" Value="E:System.Windows.Forms.Label.BackgroundImageChanged" />
<MemberSignature Language="VB.NET" Value="Public Custom Event BackgroundImageChanged As EventHandler " />
<MemberSignature Language="C++ CLI" Value="public:&#xA; event EventHandler ^ BackgroundImageChanged;" />
<MemberSignature Language="F#" Value="member this.BackgroundImageChanged : EventHandler " Usage="member this.BackgroundImageChanged : System.EventHandler " />
<MemberType>Event</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.Browsable(false)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.EventHandler</ReturnType>
</ReturnValue>
<Docs>
<summary>Occurs when the <see cref="P:System.Windows.Forms.Label.BackgroundImage" /> property changes.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This event is not relevant for this class.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="BackgroundImageLayout">
<MemberSignature Language="C#" Value="public override System.Windows.Forms.ImageLayout BackgroundImageLayout { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.Windows.Forms.ImageLayout BackgroundImageLayout" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.Label.BackgroundImageLayout" />
<MemberSignature Language="VB.NET" Value="Public Overrides Property BackgroundImageLayout As ImageLayout" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property System::Windows::Forms::ImageLayout BackgroundImageLayout { System::Windows::Forms::ImageLayout get(); void set(System::Windows::Forms::ImageLayout value); };" />
<MemberSignature Language="F#" Value="member this.BackgroundImageLayout : System.Windows.Forms.ImageLayout with get, set" Usage="System.Windows.Forms.Label.BackgroundImageLayout" />
<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-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.ComponentModel.Browsable(false)</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.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Windows.Forms.ImageLayout</ReturnType>
</ReturnValue>
<Docs>
<summary>This property is not relevant for this class.</summary>
<value>An <see cref="T:System.Windows.Forms.ImageLayout" /> object.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This property is not relevant for this class.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="BackgroundImageLayoutChanged">
<MemberSignature Language="C#" Value="public event EventHandler BackgroundImageLayoutChanged;" />
<MemberSignature Language="ILAsm" Value=".event class System.EventHandler BackgroundImageLayoutChanged" />
<MemberSignature Language="DocId" Value="E:System.Windows.Forms.Label.BackgroundImageLayoutChanged" />
<MemberSignature Language="VB.NET" Value="Public Custom Event BackgroundImageLayoutChanged As EventHandler " />
<MemberSignature Language="C++ CLI" Value="public:&#xA; event EventHandler ^ BackgroundImageLayoutChanged;" />
<MemberSignature Language="F#" Value="member this.BackgroundImageLayoutChanged : EventHandler " Usage="member this.BackgroundImageLayoutChanged : System.EventHandler " />
<MemberType>Event</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<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.ComponentModel.Browsable(false)</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.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.EventHandler</ReturnType>
</ReturnValue>
<Docs>
<summary>Occurs when the <see cref="P:System.Windows.Forms.Label.BackgroundImageLayout" /> property changes.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This event is not relevant for this class.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="BorderStyle">
<MemberSignature Language="C#" Value="public virtual System.Windows.Forms.BorderStyle BorderStyle { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.Windows.Forms.BorderStyle BorderStyle" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.Label.BorderStyle" />
<MemberSignature Language="VB.NET" Value="Public Overridable Property BorderStyle As BorderStyle" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property System::Windows::Forms::BorderStyle BorderStyle { System::Windows::Forms::BorderStyle get(); void set(System::Windows::Forms::BorderStyle value); };" />
<MemberSignature Language="F#" Value="member this.BorderStyle : System.Windows.Forms.BorderStyle with get, set" Usage="System.Windows.Forms.Label.BorderStyle" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.DefaultValue(Mono.Cecil.CustomAttributeArgument)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Runtime.InteropServices.DispId(-504)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Windows.Forms.BorderStyle</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the border style for the control.</summary>
<value>One of the <see cref="T:System.Windows.Forms.BorderStyle" /> values. The default is <see langword="BorderStyle.None" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
You can use this property to add a border to the control. This property is typically used to differentiate a <xref:System.Windows.Forms.Label> that labels another control from a <xref:System.Windows.Forms.Label> that displays the status of a process in an application.
## Examples
The following code example demonstrates how to create a <xref:System.Windows.Forms.Label> control that has a three-dimensional border and an image displayed using the <xref:System.Windows.Forms.Label.ImageList%2A> and <xref:System.Windows.Forms.Label.ImageIndex%2A> properties. The control also has a caption with a mnemonic character specified. The example code uses the <xref:System.Windows.Forms.Label.PreferredHeight%2A> and <xref:System.Windows.Forms.Label.PreferredWidth%2A> properties to properly size the <xref:System.Windows.Forms.Label> control on the form on which it is displayed. This example requires that an <xref:System.Windows.Forms.ImageList> has been created and named imageList1 and that it has loaded two images. The example also requires that the code is within a form that has the <xref:System.Drawing?displayProperty=nameWithType> namespace added to its code.
[!code-cpp[Classic Label Example#1](~/samples/snippets/cpp/VS_Snippets_Winforms/Classic Label Example/CPP/source.cpp#1)]
[!code-csharp[Classic Label Example#1](~/samples/snippets/csharp/VS_Snippets_Winforms/Classic Label Example/CS/source.cs#1)]
[!code-vb[Classic Label Example#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/Classic Label Example/VB/source.vb#1)]
]]></format>
</remarks>
<exception cref="T:System.ComponentModel.InvalidEnumArgumentException">The value assigned is not one of the <see cref="T:System.Windows.Forms.BorderStyle" /> values.</exception>
<altmember cref="T:System.Windows.Forms.BorderStyle" />
</Docs>
</Member>
<Member MemberName="CalcImageRenderBounds">
<MemberSignature Language="C#" Value="protected System.Drawing.Rectangle CalcImageRenderBounds (System.Drawing.Image image, System.Drawing.Rectangle r, System.Drawing.ContentAlignment align);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig instance valuetype System.Drawing.Rectangle CalcImageRenderBounds(class System.Drawing.Image image, valuetype System.Drawing.Rectangle r, valuetype System.Drawing.ContentAlignment align) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.Label.CalcImageRenderBounds(System.Drawing.Image,System.Drawing.Rectangle,System.Drawing.ContentAlignment)" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; System::Drawing::Rectangle CalcImageRenderBounds(System::Drawing::Image ^ image, System::Drawing::Rectangle r, System::Drawing::ContentAlignment align);" />
<MemberSignature Language="F#" Value="member this.CalcImageRenderBounds : System.Drawing.Image * System.Drawing.Rectangle * System.Drawing.ContentAlignment -&gt; System.Drawing.Rectangle" Usage="label.CalcImageRenderBounds (image, r, align)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Drawing.Rectangle</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="image" Type="System.Drawing.Image" />
<Parameter Name="r" Type="System.Drawing.Rectangle" />
<Parameter Name="align" Type="System.Drawing.ContentAlignment" />
</Parameters>
<Docs>
<param name="image">The <see cref="T:System.Drawing.Image" /> used to determine size and location when drawn within the control.</param>
<param name="r">A <see cref="T:System.Drawing.Rectangle" /> that represents the area to draw the image in.</param>
<param name="align">The alignment of content within the control.</param>
<summary>Determines the size and location of an image drawn within the <see cref="T:System.Windows.Forms.Label" /> control based on the alignment of the control.</summary>
<returns>A <see cref="T:System.Drawing.Rectangle" /> that represents the size and location of the specified image within the control.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
You can use this method within a derived class of <xref:System.Windows.Forms.Label>, to determine the size and location of an image to draw within the <xref:System.Windows.Forms.Label> control based on its location within the control. The location of the image is based on the value of the control's <xref:System.Windows.Forms.Label.ImageAlign%2A> property.
]]></format>
</remarks>
<altmember cref="T:System.Drawing.Rectangle" />
<altmember cref="T:System.Drawing.Image" />
<altmember cref="P:System.Windows.Forms.Label.ImageAlign" />
</Docs>
</Member>
<Member MemberName="CreateAccessibilityInstance">
<MemberSignature Language="C#" Value="protected override System.Windows.Forms.AccessibleObject CreateAccessibilityInstance ();" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig virtual instance class System.Windows.Forms.AccessibleObject CreateAccessibilityInstance() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.Label.CreateAccessibilityInstance" />
<MemberSignature Language="VB.NET" Value="Protected Overrides Function CreateAccessibilityInstance () As AccessibleObject" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; override System::Windows::Forms::AccessibleObject ^ CreateAccessibilityInstance();" />
<MemberSignature Language="F#" Value="override this.CreateAccessibilityInstance : unit -&gt; System.Windows.Forms.AccessibleObject" Usage="label.CreateAccessibilityInstance " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Windows.Forms.AccessibleObject</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Creates a new accessibility object for the control.</summary>
<returns>A new <see cref="T:System.Windows.Forms.AccessibleObject" /> for the control.</returns>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="CreateParams">
<MemberSignature Language="C#" Value="protected override System.Windows.Forms.CreateParams CreateParams { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Windows.Forms.CreateParams CreateParams" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.Label.CreateParams" />
<MemberSignature Language="VB.NET" Value="Protected Overrides ReadOnly Property CreateParams As CreateParams" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; virtual property System::Windows::Forms::CreateParams ^ CreateParams { System::Windows::Forms::CreateParams ^ get(); };" />
<MemberSignature Language="F#" Value="member this.CreateParams : System.Windows.Forms.CreateParams" Usage="System.Windows.Forms.Label.CreateParams" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Windows.Forms.CreateParams</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the required creation parameters when the control handle is created.</summary>
<value>A <see cref="T:System.Windows.Forms.CreateParams" /> that contains the required creation parameters when the handle to the control is created.</value>
<remarks>To be added.</remarks>
<permission cref="T:System.Security.Permissions.SecurityPermission">for operating with unmanaged code. Associated enumeration: <see cref="F:System.Security.Permissions.SecurityPermissionFlag.UnmanagedCode" /></permission>
</Docs>
</Member>
<Member MemberName="DefaultImeMode">
<MemberSignature Language="C#" Value="protected override System.Windows.Forms.ImeMode DefaultImeMode { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.Windows.Forms.ImeMode DefaultImeMode" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.Label.DefaultImeMode" />
<MemberSignature Language="VB.NET" Value="Protected Overrides ReadOnly Property DefaultImeMode As ImeMode" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; virtual property System::Windows::Forms::ImeMode DefaultImeMode { System::Windows::Forms::ImeMode get(); };" />
<MemberSignature Language="F#" Value="member this.DefaultImeMode : System.Windows.Forms.ImeMode" Usage="System.Windows.Forms.Label.DefaultImeMode" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Windows.Forms.ImeMode</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the default Input Method Editor (IME) mode supported by this control.</summary>
<value>One of the <see cref="T:System.Windows.Forms.ImeMode" /> supported by this control. The default is <see cref="F:System.Windows.Forms.ImeMode.Disable" />.</value>
<remarks>To be added.</remarks>
<altmember cref="T:System.Windows.Forms.ImeMode" />
</Docs>
</Member>
<Member MemberName="DefaultMargin">
<MemberSignature Language="C#" Value="protected override System.Windows.Forms.Padding DefaultMargin { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.Windows.Forms.Padding DefaultMargin" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.Label.DefaultMargin" />
<MemberSignature Language="VB.NET" Value="Protected Overrides ReadOnly Property DefaultMargin As Padding" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; virtual property System::Windows::Forms::Padding DefaultMargin { System::Windows::Forms::Padding get(); };" />
<MemberSignature Language="F#" Value="member this.DefaultMargin : System.Windows.Forms.Padding" Usage="System.Windows.Forms.Label.DefaultMargin" />
<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 space, in pixels, that is specified by default between controls.</summary>
<value>A <see cref="T:System.Windows.Forms.Padding" /> value that represents the default space between controls.</value>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="DefaultSize">
<MemberSignature Language="C#" Value="protected override System.Drawing.Size DefaultSize { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.Drawing.Size DefaultSize" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.Label.DefaultSize" />
<MemberSignature Language="VB.NET" Value="Protected Overrides ReadOnly Property DefaultSize As Size" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; virtual property System::Drawing::Size DefaultSize { System::Drawing::Size get(); };" />
<MemberSignature Language="F#" Value="member this.DefaultSize : System.Drawing.Size" Usage="System.Windows.Forms.Label.DefaultSize" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Drawing.Size</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the default size of the control.</summary>
<value>The default <see cref="T:System.Drawing.Size" /> of the control.</value>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="Dispose">
<MemberSignature Language="C#" Value="protected override void Dispose (bool disposing);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig virtual instance void Dispose(bool disposing) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.Label.Dispose(System.Boolean)" />
<MemberSignature Language="VB.NET" Value="Protected Overrides Sub Dispose (disposing As Boolean)" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; override void Dispose(bool disposing);" />
<MemberSignature Language="F#" Value="override this.Dispose : bool -&gt; unit" Usage="label.Dispose disposing" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="disposing" Type="System.Boolean" />
</Parameters>
<Docs>
<param name="disposing">
<see langword="true" /> to release both managed and unmanaged resources; <see langword="false" /> to release only unmanaged resources.</param>
<summary>Releases the unmanaged resources used by the <see cref="T:System.Windows.Forms.Label" /> and optionally releases the managed resources.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method is called by the public `Dispose` method and the <xref:System.Object.Finalize%2A> method. `Dispose` invokes the protected `Dispose(Boolean)` method with the `disposing` parameter set to `true`. <xref:System.Object.Finalize%2A> invokes `Dispose` with `disposing` set to `false`.
When the `disposing` parameter is true, this method releases all resources held by any managed objects that this <xref:System.Windows.Forms.Label> references. This method invokes the `Dispose` method of each referenced object.
]]></format>
</remarks>
<block subset="none" type="overrides">
<para>
<see langword="Dispose" /> can be called multiple times by other objects. When overriding <see langword="Dispose(Boolean)" /> be careful not to reference objects that have been previously disposed of in an earlier call to <see langword="Dispose" />. For more information about how to implement <see langword="Dispose(Boolean)" />, see [Implementing a Dispose Method](~/docs/standard/garbage-collection/implementing-dispose.md).
For more information about <see langword="Dispose" /> and <see cref="M:System.Object.Finalize" />, see [Cleaning Up Unmanaged Resources](~/docs/standard/garbage-collection/unmanaged.md) and [Overriding the Finalize Method](https://docs.microsoft.com/previous-versions/dotnet/netframework-4.0/ddae83kx(v=vs.100)).</para>
</block>
</Docs>
</Member>
<Member MemberName="DrawImage">
<MemberSignature Language="C#" Value="protected void DrawImage (System.Drawing.Graphics g, System.Drawing.Image image, System.Drawing.Rectangle r, System.Drawing.ContentAlignment align);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig instance void DrawImage(class System.Drawing.Graphics g, class System.Drawing.Image image, valuetype System.Drawing.Rectangle r, valuetype System.Drawing.ContentAlignment align) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.Label.DrawImage(System.Drawing.Graphics,System.Drawing.Image,System.Drawing.Rectangle,System.Drawing.ContentAlignment)" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; void DrawImage(System::Drawing::Graphics ^ g, System::Drawing::Image ^ image, System::Drawing::Rectangle r, System::Drawing::ContentAlignment align);" />
<MemberSignature Language="F#" Value="member this.DrawImage : System.Drawing.Graphics * System.Drawing.Image * System.Drawing.Rectangle * System.Drawing.ContentAlignment -&gt; unit" Usage="label.DrawImage (g, image, r, align)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="g" Type="System.Drawing.Graphics" />
<Parameter Name="image" Type="System.Drawing.Image" />
<Parameter Name="r" Type="System.Drawing.Rectangle" />
<Parameter Name="align" Type="System.Drawing.ContentAlignment" />
</Parameters>
<Docs>
<param name="g">The <see cref="T:System.Drawing.Graphics" /> surface on which to draw.</param>
<param name="image">The <see cref="T:System.Drawing.Image" /> to draw.</param>
<param name="r">The <see cref="T:System.Drawing.Rectangle" /> bounds to draw within.</param>
<param name="align">The alignment of the image to draw within the <see cref="T:System.Windows.Forms.Label" />.</param>
<summary>Draws an <see cref="T:System.Drawing.Image" /> within the specified bounds.</summary>
<remarks>To be added.</remarks>
<block subset="none" type="overrides">
<para>When you are creating your own control that derives from <see cref="T:System.Windows.Forms.Label" />, you can use this method to draw images onto the surface of the control.</para>
</block>
<altmember cref="T:System.Drawing.ContentAlignment" />
<altmember cref="T:System.Drawing.Graphics" />
<altmember cref="T:System.Drawing.Image" />
<altmember cref="T:System.Drawing.Rectangle" />
</Docs>
</Member>
<Member MemberName="FlatStyle">
<MemberSignature Language="C#" Value="public System.Windows.Forms.FlatStyle FlatStyle { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.Windows.Forms.FlatStyle FlatStyle" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.Label.FlatStyle" />
<MemberSignature Language="VB.NET" Value="Public Property FlatStyle As FlatStyle" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::Windows::Forms::FlatStyle FlatStyle { System::Windows::Forms::FlatStyle get(); void set(System::Windows::Forms::FlatStyle value); };" />
<MemberSignature Language="F#" Value="member this.FlatStyle : System.Windows.Forms.FlatStyle with get, set" Usage="System.Windows.Forms.Label.FlatStyle" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<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.FlatStyle</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the flat style appearance of the label control.</summary>
<value>One of the <see cref="T:System.Windows.Forms.FlatStyle" /> values. The default value is <see langword="Standard" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
When the <xref:System.Windows.Forms.Label.FlatStyle%2A> property is set to `FlatStyle.System`, any values assigned to the <xref:System.Windows.Forms.Label.ImageList%2A>, <xref:System.Windows.Forms.Label.Image%2A>, <xref:System.Windows.Forms.Label.ImageIndex%2A>, and <xref:System.Windows.Forms.Label.ImageAlign%2A> properties are ignored. In addition, the <xref:System.Windows.Forms.Label.TextAlign%2A> property ignores any property values that are not vertical property settings. Horizontally aligned settings of the <xref:System.Windows.Forms.Label.TextAlign%2A> property are aligned to the top of the control. For example, if you set the <xref:System.Windows.Forms.Label.TextAlign%2A> property to `ContentAlignment.TopCenter`, `ContentAlignment.MiddleCenter`, or `ContentAlignment.BottomCenter`, when the <xref:System.Windows.Forms.Label.FlatStyle%2A> property is set to `FlatStyle.System`, the text in the <xref:System.Windows.Forms.Label> control will be aligned to the top and center locations within the bounds of the control.
> [!NOTE]
> In the .NET Framework version 1.1, setting the <xref:System.Windows.Forms.Label.FlatStyle%2A> property to `FlatStyle.System` does not cause the value of the <xref:System.Windows.Forms.Label.TextAlign%2A> property to be ignored. In addition, the property has no effect in the derived class, <xref:System.Windows.Forms.LinkLabel>.
]]></format>
</remarks>
<exception cref="T:System.ComponentModel.InvalidEnumArgumentException">The value assigned is not one of the <see cref="T:System.Windows.Forms.FlatStyle" /> values.</exception>
</Docs>
</Member>
<Member MemberName="GetPreferredSize">
<MemberSignature Language="C#" Value="public override System.Drawing.Size GetPreferredSize (System.Drawing.Size proposedSize);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance valuetype System.Drawing.Size GetPreferredSize(valuetype System.Drawing.Size proposedSize) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.Label.GetPreferredSize(System.Drawing.Size)" />
<MemberSignature Language="VB.NET" Value="Public Overrides Function GetPreferredSize (proposedSize As Size) As Size" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; override System::Drawing::Size GetPreferredSize(System::Drawing::Size proposedSize);" />
<MemberSignature Language="F#" Value="override this.GetPreferredSize : System.Drawing.Size -&gt; System.Drawing.Size" Usage="label.GetPreferredSize proposedSize" />
<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.Drawing.Size</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="proposedSize" Type="System.Drawing.Size" Index="0" FrameworkAlternate="netcore-3.0;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" />
</Parameters>
<Docs>
<param name="proposedSize">The custom-sized area for a control.</param>
<summary>Retrieves the size of a rectangular area into which a control can be fitted.</summary>
<returns>An ordered pair of type <see cref="T:System.Drawing.Size" /> representing the width and height of a rectangle.</returns>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="Image">
<MemberSignature Language="C#" Value="public System.Drawing.Image Image { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Drawing.Image Image" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.Label.Image" />
<MemberSignature Language="VB.NET" Value="Public Property Image As Image" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::Drawing::Image ^ Image { System::Drawing::Image ^ get(); void set(System::Drawing::Image ^ value); };" />
<MemberSignature Language="F#" Value="member this.Image : System.Drawing.Image with get, set" Usage="System.Windows.Forms.Label.Image" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.Localizable(true)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Drawing.Image</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the image that is displayed on a <see cref="T:System.Windows.Forms.Label" />.</summary>
<value>An <see cref="T:System.Drawing.Image" /> displayed on the <see cref="T:System.Windows.Forms.Label" />. The default is <see langword="null" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Windows.Forms.Label.Image%2A> property cannot be used at the same time as the <xref:System.Windows.Forms.Label.ImageList%2A> and <xref:System.Windows.Forms.Label.ImageIndex%2A> properties. When the <xref:System.Windows.Forms.Label.Image%2A> property is used to display an image, the <xref:System.Windows.Forms.Label.ImageList%2A> and <xref:System.Windows.Forms.Label.ImageIndex%2A> properties are automatically set to their default settings.
## Examples
The following code example demonstrates how to create a <xref:System.Windows.Forms.Label> and then to display an <xref:System.Drawing.Image> behind the <xref:System.Windows.Forms.Label>. First, the example creates a <xref:System.Windows.Forms.Label> and then creates an <xref:System.Drawing.Image> based on a disk file. Next, the <xref:System.Windows.Forms.Control.Size%2A> property is initialized to contain the <xref:System.Drawing.Image>. Finally, the <xref:System.Windows.Forms.Label.Image%2A> property is initialized to the <xref:System.Drawing.Image>.
[!code-cpp[Label_Image#1](~/samples/snippets/cpp/VS_Snippets_Winforms/Label_Image/CPP/form1.cpp#1)]
[!code-csharp[Label_Image#1](~/samples/snippets/csharp/VS_Snippets_Winforms/Label_Image/CS/form1.cs#1)]
[!code-vb[Label_Image#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/Label_Image/VB/form1.vb#1)]
]]></format>
</remarks>
<altmember cref="T:System.Drawing.Image" />
<altmember cref="P:System.Windows.Forms.Label.ImageAlign" />
<altmember cref="P:System.Windows.Forms.Label.ImageList" />
<altmember cref="P:System.Windows.Forms.Label.ImageIndex" />
</Docs>
</Member>
<Member MemberName="ImageAlign">
<MemberSignature Language="C#" Value="public System.Drawing.ContentAlignment ImageAlign { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.Drawing.ContentAlignment ImageAlign" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.Label.ImageAlign" />
<MemberSignature Language="VB.NET" Value="Public Property ImageAlign As ContentAlignment" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::Drawing::ContentAlignment ImageAlign { System::Drawing::ContentAlignment get(); void set(System::Drawing::ContentAlignment value); };" />
<MemberSignature Language="F#" Value="member this.ImageAlign : System.Drawing.ContentAlignment with get, set" Usage="System.Windows.Forms.Label.ImageAlign" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.Localizable(true)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.DefaultValue(Mono.Cecil.CustomAttributeArgument)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Drawing.ContentAlignment</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the alignment of an image that is displayed in the control.</summary>
<value>One of the <see cref="T:System.Drawing.ContentAlignment" /> values. The default is <see langword="ContentAlignment.MiddleCenter" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This property enables you to align an image within the boundaries of the <xref:System.Windows.Forms.Label> control to ensure that the image is properly displayed. You can add an image to a <xref:System.Windows.Forms.Label> using the <xref:System.Windows.Forms.Label.Image%2A> property or the <xref:System.Windows.Forms.Label.ImageList%2A> and <xref:System.Windows.Forms.Label.ImageIndex%2A> properties. Images displayed in the control cannot be stretched or shrunk to fill the control if the control is larger or smaller than the image.
## Examples
The following code example demonstrates how to create a <xref:System.Windows.Forms.Label> control that has a three-dimensional border and an image displayed using the <xref:System.Windows.Forms.Label.ImageList%2A> and <xref:System.Windows.Forms.Label.ImageIndex%2A> properties. The control also has a caption with a mnemonic character specified. The example code uses the <xref:System.Windows.Forms.Label.PreferredHeight%2A> and <xref:System.Windows.Forms.Label.PreferredWidth%2A> properties to properly size the <xref:System.Windows.Forms.Label> control on the form on which it is displayed. This example requires that an <xref:System.Windows.Forms.ImageList> has been created and named imageList1 and that it has loaded two images. The example also requires that the code is within a form that has the <xref:System.Drawing?displayProperty=nameWithType> namespace added to its code.
[!code-cpp[Classic Label Example#1](~/samples/snippets/cpp/VS_Snippets_Winforms/Classic Label Example/CPP/source.cpp#1)]
[!code-csharp[Classic Label Example#1](~/samples/snippets/csharp/VS_Snippets_Winforms/Classic Label Example/CS/source.cs#1)]
[!code-vb[Classic Label Example#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/Classic Label Example/VB/source.vb#1)]
]]></format>
</remarks>
<exception cref="T:System.ComponentModel.InvalidEnumArgumentException">The value assigned is not one of the <see cref="T:System.Drawing.ContentAlignment" /> values.</exception>
<altmember cref="T:System.Drawing.ContentAlignment" />
<altmember cref="P:System.Windows.Forms.Label.Image" />
<altmember cref="P:System.Windows.Forms.Label.ImageIndex" />
<altmember cref="P:System.Windows.Forms.Label.ImageList" />
</Docs>
</Member>
<Member MemberName="ImageIndex">
<MemberSignature Language="C#" Value="public int ImageIndex { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance int32 ImageIndex" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.Label.ImageIndex" />
<MemberSignature Language="VB.NET" Value="Public Property ImageIndex As Integer" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property int ImageIndex { int get(); void set(int value); };" />
<MemberSignature Language="F#" Value="member this.ImageIndex : int with get, set" Usage="System.Windows.Forms.Label.ImageIndex" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.DefaultValue(-1)</AttributeName>
</Attribute>
<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.Editor("System.Windows.Forms.Design.ImageIndexEditor, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(System.Drawing.Design.UITypeEditor))</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.Localizable(true)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.TypeConverter(typeof(System.Windows.Forms.ImageIndexConverter))</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-1.1">
<AttributeName>System.ComponentModel.Editor("System.Windows.Forms.Design.ImageIndexEditor, System.Design, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(System.Drawing.Design.UITypeEditor))</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5">
<AttributeName>System.ComponentModel.Editor("System.Windows.Forms.Design.ImageIndexEditor, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(System.Drawing.Design.UITypeEditor))</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.ComponentModel.RefreshProperties(System.ComponentModel.RefreshProperties.Repaint)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the index value of the image displayed on the <see cref="T:System.Windows.Forms.Label" />.</summary>
<value>A zero-based index that represents the position in the <see cref="T:System.Windows.Forms.ImageList" /> control (assigned to the <see cref="P:System.Windows.Forms.Label.ImageList" /> property) where the image is located. The default is -1.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Windows.Forms.Label.ImageIndex%2A> and the <xref:System.Windows.Forms.Label.ImageList%2A> properties cannot be used at the same time as the <xref:System.Windows.Forms.Label.Image%2A> property. When the <xref:System.Windows.Forms.Label.ImageIndex%2A> property and <xref:System.Windows.Forms.Label.ImageList%2A> properties are used to display an image, the <xref:System.Windows.Forms.Label.Image%2A> property is automatically set to `null`.
## Examples
The following code example demonstrates how to create a <xref:System.Windows.Forms.Label> control that has a three-dimensional border and an image displayed using the <xref:System.Windows.Forms.Label.ImageList%2A> and <xref:System.Windows.Forms.Label.ImageIndex%2A> properties. The control also has a caption with a mnemonic character specified. The example code uses the <xref:System.Windows.Forms.Label.PreferredHeight%2A> and <xref:System.Windows.Forms.Label.PreferredWidth%2A> properties to properly size the <xref:System.Windows.Forms.Label> control on the form on which it is displayed. This example requires that an <xref:System.Windows.Forms.ImageList> has been created and named imageList1 and that it has loaded two images. The example also requires that the code is within a form that has the <xref:System.Drawing?displayProperty=nameWithType> namespace added to its code.
[!code-cpp[Classic Label Example#1](~/samples/snippets/cpp/VS_Snippets_Winforms/Classic Label Example/CPP/source.cpp#1)]
[!code-csharp[Classic Label Example#1](~/samples/snippets/csharp/VS_Snippets_Winforms/Classic Label Example/CS/source.cs#1)]
[!code-vb[Classic Label Example#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/Classic Label Example/VB/source.vb#1)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentOutOfRangeException">The value assigned is less than the lower bounds of the <see cref="P:System.Windows.Forms.Label.ImageIndex" /> property.</exception>
<altmember cref="P:System.Windows.Forms.Label.Image" />
<altmember cref="P:System.Windows.Forms.Label.ImageAlign" />
<altmember cref="P:System.Windows.Forms.Label.ImageList" />
</Docs>
</Member>
<Member MemberName="ImageKey">
<MemberSignature Language="C#" Value="public string ImageKey { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance string ImageKey" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.Label.ImageKey" />
<MemberSignature Language="VB.NET" Value="Public Property ImageKey As String" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::String ^ ImageKey { System::String ^ get(); void set(System::String ^ value); };" />
<MemberSignature Language="F#" Value="member this.ImageKey : string with get, set" Usage="System.Windows.Forms.Label.ImageKey" />
<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-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.ComponentModel.DefaultValue("")</AttributeName>
</Attribute>
<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.Editor("System.Windows.Forms.Design.ImageIndexEditor, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(System.Drawing.Design.UITypeEditor))</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.ComponentModel.Localizable(true)</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.ComponentModel.TypeConverter(typeof(System.Windows.Forms.ImageKeyConverter))</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5">
<AttributeName>System.ComponentModel.Editor("System.Windows.Forms.Design.ImageIndexEditor, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(System.Drawing.Design.UITypeEditor))</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.ComponentModel.RefreshProperties(System.ComponentModel.RefreshProperties.Repaint)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the key accessor for the image in the <see cref="P:System.Windows.Forms.Label.ImageList" />.</summary>
<value>A string representing the key of the image.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Windows.Forms.Label.ImageKey%2A> property specifies the image from the image list to display on the <xref:System.Windows.Forms.Label>.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="ImageList">
<MemberSignature Language="C#" Value="public System.Windows.Forms.ImageList ImageList { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Windows.Forms.ImageList ImageList" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.Label.ImageList" />
<MemberSignature Language="VB.NET" Value="Public Property ImageList As ImageList" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::Windows::Forms::ImageList ^ ImageList { System::Windows::Forms::ImageList ^ get(); void set(System::Windows::Forms::ImageList ^ value); };" />
<MemberSignature Language="F#" Value="member this.ImageList : System.Windows.Forms.ImageList with get, set" Usage="System.Windows.Forms.Label.ImageList" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.DefaultValue(null)</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.ComponentModel.RefreshProperties(System.ComponentModel.RefreshProperties.Repaint)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Windows.Forms.ImageList</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the <see cref="T:System.Windows.Forms.ImageList" /> that contains the images to display in the <see cref="T:System.Windows.Forms.Label" /> control.</summary>
<value>An <see cref="T:System.Windows.Forms.ImageList" /> that stores the collection of <see cref="T:System.Drawing.Image" /> objects. The default value is <see langword="null" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Windows.Forms.Label.ImageIndex%2A> and the <xref:System.Windows.Forms.Label.ImageList%2A> properties cannot be used at the same time as the <xref:System.Windows.Forms.Label.Image%2A> property. When the <xref:System.Windows.Forms.Label.ImageIndex%2A> property and <xref:System.Windows.Forms.Label.ImageList%2A> properties are used to display an image, the <xref:System.Windows.Forms.Label.Image%2A> property is set to `null`.
> [!NOTE]
> The <xref:System.Windows.Forms.Label> will not be garbage collected if its <xref:System.Windows.Forms.Label.ImageList%2A> is still referenced elsewhere. Set the <xref:System.Windows.Forms.Label.ImageList%2A> property of the <xref:System.Windows.Forms.Label> to `null` to enable efficient garbage collection.
## Examples
The following code example demonstrates how to create a <xref:System.Windows.Forms.Label> control that has a three-dimensional border and an image displayed using the <xref:System.Windows.Forms.Label.ImageList%2A> and <xref:System.Windows.Forms.Label.ImageIndex%2A> properties. The control also has a caption with a mnemonic character specified. The example code uses the <xref:System.Windows.Forms.Label.PreferredHeight%2A> and <xref:System.Windows.Forms.Label.PreferredWidth%2A> properties to properly size the <xref:System.Windows.Forms.Label> control on the form on which it is displayed. This example requires that an <xref:System.Windows.Forms.ImageList> has been created and named imageList1 and that it has loaded two images. The example also requires that the code is within a form that has the <xref:System.Drawing?displayProperty=nameWithType> namespace added to its code.
[!code-cpp[Classic Label Example#1](~/samples/snippets/cpp/VS_Snippets_Winforms/Classic Label Example/CPP/source.cpp#1)]
[!code-csharp[Classic Label Example#1](~/samples/snippets/csharp/VS_Snippets_Winforms/Classic Label Example/CS/source.cs#1)]
[!code-vb[Classic Label Example#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/Classic Label Example/VB/source.vb#1)]
]]></format>
</remarks>
<altmember cref="P:System.Windows.Forms.Label.Image" />
<altmember cref="P:System.Windows.Forms.Label.ImageAlign" />
<altmember cref="P:System.Windows.Forms.Label.ImageIndex" />
<altmember cref="T:System.Windows.Forms.ImageList" />
</Docs>
</Member>
<Member MemberName="ImeMode">
<MemberSignature Language="C#" Value="public System.Windows.Forms.ImeMode ImeMode { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.Windows.Forms.ImeMode ImeMode" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.Label.ImeMode" />
<MemberSignature Language="VB.NET" Value="Public Property ImeMode As ImeMode" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::Windows::Forms::ImeMode ImeMode { System::Windows::Forms::ImeMode get(); void set(System::Windows::Forms::ImeMode value); };" />
<MemberSignature Language="F#" Value="member this.ImeMode : System.Windows.Forms.ImeMode with get, set" Usage="System.Windows.Forms.Label.ImeMode" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.Browsable(false)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Windows.Forms.ImeMode</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the Input Method Editor (IME) mode supported by this control.</summary>
<value>One of the <see cref="T:System.Windows.Forms.ImeMode" /> values.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This property is not relevant for this class.
]]></format>
</remarks>
<exception cref="T:System.ComponentModel.InvalidEnumArgumentException">The value assigned to this property is not within the range of valid values specified in the enumeration.</exception>
<altmember cref="T:System.Windows.Forms.ImeMode" />
<altmember cref="P:System.Windows.Forms.Label.DefaultImeMode" />
</Docs>
</Member>
<Member MemberName="ImeModeChanged">
<MemberSignature Language="C#" Value="public event EventHandler ImeModeChanged;" />
<MemberSignature Language="ILAsm" Value=".event class System.EventHandler ImeModeChanged" />
<MemberSignature Language="DocId" Value="E:System.Windows.Forms.Label.ImeModeChanged" />
<MemberSignature Language="VB.NET" Value="Public Custom Event ImeModeChanged As EventHandler " />
<MemberSignature Language="C++ CLI" Value="public:&#xA; event EventHandler ^ ImeModeChanged;" />
<MemberSignature Language="F#" Value="member this.ImeModeChanged : EventHandler " Usage="member this.ImeModeChanged : System.EventHandler " />
<MemberType>Event</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.Browsable(false)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.EventHandler</ReturnType>
</ReturnValue>
<Docs>
<summary>Occurs when the <see cref="P:System.Windows.Forms.Label.ImeMode" /> property changes.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This event is not relevant for this class.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="KeyDown">
<MemberSignature Language="C#" Value="public event System.Windows.Forms.KeyEventHandler KeyDown;" />
<MemberSignature Language="ILAsm" Value=".event class System.Windows.Forms.KeyEventHandler KeyDown" />
<MemberSignature Language="DocId" Value="E:System.Windows.Forms.Label.KeyDown" />
<MemberSignature Language="VB.NET" Value="Public Custom Event KeyDown As KeyEventHandler " />
<MemberSignature Language="C++ CLI" Value="public:&#xA; event System::Windows::Forms::KeyEventHandler ^ KeyDown;" />
<MemberSignature Language="F#" Value="member this.KeyDown : System.Windows.Forms.KeyEventHandler " Usage="member this.KeyDown : System.Windows.Forms.KeyEventHandler " />
<MemberType>Event</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.Browsable(false)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Windows.Forms.KeyEventHandler</ReturnType>
</ReturnValue>
<Docs>
<summary>Occurs when the user presses a key while the label has focus.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This event is not relevant for this class.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="KeyPress">
<MemberSignature Language="C#" Value="public event System.Windows.Forms.KeyPressEventHandler KeyPress;" />
<MemberSignature Language="ILAsm" Value=".event class System.Windows.Forms.KeyPressEventHandler KeyPress" />
<MemberSignature Language="DocId" Value="E:System.Windows.Forms.Label.KeyPress" />
<MemberSignature Language="VB.NET" Value="Public Custom Event KeyPress As KeyPressEventHandler " />
<MemberSignature Language="C++ CLI" Value="public:&#xA; event System::Windows::Forms::KeyPressEventHandler ^ KeyPress;" />
<MemberSignature Language="F#" Value="member this.KeyPress : System.Windows.Forms.KeyPressEventHandler " Usage="member this.KeyPress : System.Windows.Forms.KeyPressEventHandler " />
<MemberType>Event</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.Browsable(false)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Windows.Forms.KeyPressEventHandler</ReturnType>
</ReturnValue>
<Docs>
<summary>Occurs when the user presses a key while the label has focus.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This event is not relevant for this class.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="KeyUp">
<MemberSignature Language="C#" Value="public event System.Windows.Forms.KeyEventHandler KeyUp;" />
<MemberSignature Language="ILAsm" Value=".event class System.Windows.Forms.KeyEventHandler KeyUp" />
<MemberSignature Language="DocId" Value="E:System.Windows.Forms.Label.KeyUp" />
<MemberSignature Language="VB.NET" Value="Public Custom Event KeyUp As KeyEventHandler " />
<MemberSignature Language="C++ CLI" Value="public:&#xA; event System::Windows::Forms::KeyEventHandler ^ KeyUp;" />
<MemberSignature Language="F#" Value="member this.KeyUp : System.Windows.Forms.KeyEventHandler " Usage="member this.KeyUp : System.Windows.Forms.KeyEventHandler " />
<MemberType>Event</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.Browsable(false)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Windows.Forms.KeyEventHandler</ReturnType>
</ReturnValue>
<Docs>
<summary>Occurs when the user releases a key while the label has focus.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This event is not relevant for this class.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="LiveSetting">
<MemberSignature Language="C#" Value="public System.Windows.Forms.Automation.AutomationLiveSetting LiveSetting { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.Windows.Forms.Automation.AutomationLiveSetting LiveSetting" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.Label.LiveSetting" />
<MemberSignature Language="VB.NET" Value="Public Property LiveSetting As AutomationLiveSetting" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::Windows::Forms::Automation::AutomationLiveSetting LiveSetting { System::Windows::Forms::Automation::AutomationLiveSetting get(); void set(System::Windows::Forms::Automation::AutomationLiveSetting value); };" />
<MemberSignature Language="F#" Value="member this.LiveSetting : System.Windows.Forms.Automation.AutomationLiveSetting with get, set" Usage="System.Windows.Forms.Label.LiveSetting" />
<MemberType>Property</MemberType>
<Implements>
<InterfaceMember>P:System.Windows.Forms.Automation.IAutomationLiveRegion.LiveSetting</InterfaceMember>
</Implements>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.8;netcore-3.0">
<AttributeName>System.ComponentModel.Browsable(true)</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-4.8;netcore-3.0">
<AttributeName>System.ComponentModel.DefaultValue(Mono.Cecil.CustomAttributeArgument)</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-4.8;netcore-3.0">
<AttributeName>System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Always)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Windows.Forms.Automation.AutomationLiveSetting</ReturnType>
</ReturnValue>
<Docs>
<summary>Indicates the politeness level that a client should use to notify the user of changes to the live region.</summary>
<value>The politeness level for notifications. Its default value is <see cref="F:System.Windows.Forms.Automation.AutomationLiveSetting.Off" />.</value>
<remarks>To be added.</remarks>
<exception cref="T:System.ComponentModel.InvalidEnumArgumentException">The value assigned is not one of the <see cref="T:System.Windows.Forms.Automation.AutomationLiveSetting" /> values.</exception>
</Docs>
</Member>
<Member MemberName="OnAutoSizeChanged">
<MemberSignature Language="C#" Value="protected virtual void OnAutoSizeChanged (EventArgs e);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig newslot virtual instance void OnAutoSizeChanged(class System.EventArgs e) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.Label.OnAutoSizeChanged(System.EventArgs)" />
<MemberSignature Language="VB.NET" Value="Protected Overridable Sub OnAutoSizeChanged (e As EventArgs)" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; virtual void OnAutoSizeChanged(EventArgs ^ e);" />
<MemberSignature Language="F#" Value="abstract member OnAutoSizeChanged : EventArgs -&gt; unit&#xA;override this.OnAutoSizeChanged : EventArgs -&gt; unit" Usage="label.OnAutoSizeChanged e" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="e" Type="System.EventArgs" Index="0" FrameworkAlternate="netframework-1.1" />
</Parameters>
<Docs>
<param name="e">An object that contains the event data.</param>
<summary>Raises the <see cref="E:System.Windows.Forms.Control.AutoSizeChanged" /> event.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="OnEnabledChanged">
<MemberSignature Language="C#" Value="protected override void OnEnabledChanged (EventArgs e);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig virtual instance void OnEnabledChanged(class System.EventArgs e) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.Label.OnEnabledChanged(System.EventArgs)" />
<MemberSignature Language="VB.NET" Value="Protected Overrides Sub OnEnabledChanged (e As EventArgs)" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; override void OnEnabledChanged(EventArgs ^ e);" />
<MemberSignature Language="F#" Value="override this.OnEnabledChanged : EventArgs -&gt; unit" Usage="label.OnEnabledChanged e" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<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.Control.EnabledChanged" /> event.</summary>
<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.Label.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="label.OnFontChanged e" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<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.Control.FontChanged" /> event.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="OnHandleDestroyed">
<MemberSignature Language="C#" Value="protected override void OnHandleDestroyed (EventArgs e);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig virtual instance void OnHandleDestroyed(class System.EventArgs e) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.Label.OnHandleDestroyed(System.EventArgs)" />
<MemberSignature Language="VB.NET" Value="Protected Overrides Sub OnHandleDestroyed (e As EventArgs)" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; override void OnHandleDestroyed(EventArgs ^ e);" />
<MemberSignature Language="F#" Value="override this.OnHandleDestroyed : EventArgs -&gt; unit" Usage="label.OnHandleDestroyed 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" Index="0" FrameworkAlternate="netcore-3.0;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" />
</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.Control.HandleDestroyed" /> 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.Label.OnHandleDestroyed%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.Label.OnHandleDestroyed(System.EventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.Label.OnHandleDestroyed(System.EventArgs)" /> method so that registered delegates receive the event.</para>
</block>
</Docs>
</Member>
<Member MemberName="OnMouseEnter">
<MemberSignature Language="C#" Value="protected override void OnMouseEnter (EventArgs e);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig virtual instance void OnMouseEnter(class System.EventArgs e) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.Label.OnMouseEnter(System.EventArgs)" />
<MemberSignature Language="VB.NET" Value="Protected Overrides Sub OnMouseEnter (e As EventArgs)" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; override void OnMouseEnter(EventArgs ^ e);" />
<MemberSignature Language="F#" Value="override this.OnMouseEnter : EventArgs -&gt; unit" Usage="label.OnMouseEnter 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" Index="0" FrameworkAlternate="netcore-3.0;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" />
</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.Control.MouseEnter" /> event.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="OnMouseLeave">
<MemberSignature Language="C#" Value="protected override void OnMouseLeave (EventArgs e);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig virtual instance void OnMouseLeave(class System.EventArgs e) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.Label.OnMouseLeave(System.EventArgs)" />
<MemberSignature Language="VB.NET" Value="Protected Overrides Sub OnMouseLeave (e As EventArgs)" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; override void OnMouseLeave(EventArgs ^ e);" />
<MemberSignature Language="F#" Value="override this.OnMouseLeave : EventArgs -&gt; unit" Usage="label.OnMouseLeave 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" Index="0" FrameworkAlternate="netcore-3.0;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" />
</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.Control.MouseLeave" /> event.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="OnPaddingChanged">
<MemberSignature Language="C#" Value="protected override void OnPaddingChanged (EventArgs e);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig virtual instance void OnPaddingChanged(class System.EventArgs e) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.Label.OnPaddingChanged(System.EventArgs)" />
<MemberSignature Language="VB.NET" Value="Protected Overrides Sub OnPaddingChanged (e As EventArgs)" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; override void OnPaddingChanged(EventArgs ^ e);" />
<MemberSignature Language="F#" Value="override this.OnPaddingChanged : EventArgs -&gt; unit" Usage="label.OnPaddingChanged 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" Index="0" FrameworkAlternate="netcore-3.0;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" />
</Parameters>
<Docs>
<param name="e">A <see cref="T:System.EventArgs" /> that contains the event data.</param>
<summary>Raises the <see cref="E:System.Windows.Forms.Control.PaddingChanged" /> event.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="OnPaint">
<MemberSignature Language="C#" Value="protected override void OnPaint (System.Windows.Forms.PaintEventArgs e);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig virtual instance void OnPaint(class System.Windows.Forms.PaintEventArgs e) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.Label.OnPaint(System.Windows.Forms.PaintEventArgs)" />
<MemberSignature Language="VB.NET" Value="Protected Overrides Sub OnPaint (e As PaintEventArgs)" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; override void OnPaint(System::Windows::Forms::PaintEventArgs ^ e);" />
<MemberSignature Language="F#" Value="override this.OnPaint : System.Windows.Forms.PaintEventArgs -&gt; unit" Usage="label.OnPaint e" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<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>Raises the <see cref="E:System.Windows.Forms.Control.Paint" /> event.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="OnParentChanged">
<MemberSignature Language="C#" Value="protected override void OnParentChanged (EventArgs e);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig virtual instance void OnParentChanged(class System.EventArgs e) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.Label.OnParentChanged(System.EventArgs)" />
<MemberSignature Language="VB.NET" Value="Protected Overrides Sub OnParentChanged (e As EventArgs)" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; override void OnParentChanged(EventArgs ^ e);" />
<MemberSignature Language="F#" Value="override this.OnParentChanged : EventArgs -&gt; unit" Usage="label.OnParentChanged e" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<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.Control.ParentChanged" /> event.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="OnRightToLeftChanged">
<MemberSignature Language="C#" Value="protected override void OnRightToLeftChanged (EventArgs e);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig virtual instance void OnRightToLeftChanged(class System.EventArgs e) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.Label.OnRightToLeftChanged(System.EventArgs)" />
<MemberSignature Language="VB.NET" Value="Protected Overrides Sub OnRightToLeftChanged (e As EventArgs)" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; override void OnRightToLeftChanged(EventArgs ^ e);" />
<MemberSignature Language="F#" Value="override this.OnRightToLeftChanged : EventArgs -&gt; unit" Usage="label.OnRightToLeftChanged 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" Index="0" FrameworkAlternate="netcore-3.0;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" />
</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.Control.RightToLeftChanged" /> 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.Label.OnRightToLeftChanged%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.Label.OnRightToLeftChanged(System.EventArgs)" /> in a derived class, be sure to call the base class' <see cref="M:System.Windows.Forms.Label.OnRightToLeftChanged(System.EventArgs)" /> method so that registered delegates receive the event.</para>
</block>
</Docs>
</Member>
<Member MemberName="OnTextAlignChanged">
<MemberSignature Language="C#" Value="protected virtual void OnTextAlignChanged (EventArgs e);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig newslot virtual instance void OnTextAlignChanged(class System.EventArgs e) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.Label.OnTextAlignChanged(System.EventArgs)" />
<MemberSignature Language="VB.NET" Value="Protected Overridable Sub OnTextAlignChanged (e As EventArgs)" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; virtual void OnTextAlignChanged(EventArgs ^ e);" />
<MemberSignature Language="F#" Value="abstract member OnTextAlignChanged : EventArgs -&gt; unit&#xA;override this.OnTextAlignChanged : EventArgs -&gt; unit" Usage="label.OnTextAlignChanged e" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<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.Label.TextAlignChanged" /> 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).
]]></format>
</remarks>
<block subset="none" type="overrides">
<para>When overriding <see cref="M:System.Windows.Forms.Label.OnTextAlignChanged(System.EventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.Label.OnTextAlignChanged(System.EventArgs)" /> method.</para>
</block>
<altmember cref="P:System.Windows.Forms.Label.TextAlign" />
<altmember cref="E:System.Windows.Forms.Label.TextAlignChanged" />
</Docs>
</Member>
<Member MemberName="OnTextChanged">
<MemberSignature Language="C#" Value="protected override void OnTextChanged (EventArgs e);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig virtual instance void OnTextChanged(class System.EventArgs e) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.Label.OnTextChanged(System.EventArgs)" />
<MemberSignature Language="VB.NET" Value="Protected Overrides Sub OnTextChanged (e As EventArgs)" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; override void OnTextChanged(EventArgs ^ e);" />
<MemberSignature Language="F#" Value="override this.OnTextChanged : EventArgs -&gt; unit" Usage="label.OnTextChanged e" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<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.Control.TextChanged" /> event.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="OnVisibleChanged">
<MemberSignature Language="C#" Value="protected override void OnVisibleChanged (EventArgs e);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig virtual instance void OnVisibleChanged(class System.EventArgs e) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.Label.OnVisibleChanged(System.EventArgs)" />
<MemberSignature Language="VB.NET" Value="Protected Overrides Sub OnVisibleChanged (e As EventArgs)" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; override void OnVisibleChanged(EventArgs ^ e);" />
<MemberSignature Language="F#" Value="override this.OnVisibleChanged : EventArgs -&gt; unit" Usage="label.OnVisibleChanged e" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<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.Control.VisibleChanged" /> event.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="PreferredHeight">
<MemberSignature Language="C#" Value="public virtual int PreferredHeight { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance int32 PreferredHeight" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.Label.PreferredHeight" />
<MemberSignature Language="VB.NET" Value="Public Overridable ReadOnly Property PreferredHeight As Integer" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property int PreferredHeight { int get(); };" />
<MemberSignature Language="F#" Value="member this.PreferredHeight : int" Usage="System.Windows.Forms.Label.PreferredHeight" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.Browsable(false)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Advanced)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the preferred height of the control.</summary>
<value>The height of the control (in pixels), assuming a single line of text is displayed.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This property returns the height that the control should be in order to properly display text, based on the font assigned to the control. You can use this property along with the <xref:System.Windows.Forms.Label.PreferredWidth%2A> property to ensure that the text in the <xref:System.Windows.Forms.Label> control is displayed properly. You can use the <xref:System.Windows.Forms.Label.AutoSize%2A> property to automatically adjust the height and the width of the <xref:System.Windows.Forms.Label> control, based on the text and font size.
> [!NOTE]
> If the <xref:System.Windows.Forms.Label.BorderStyle%2A> property of the <xref:System.Windows.Forms.Label> control is set to `BorderStyle.None`, the value returned by <xref:System.Windows.Forms.Label.PreferredHeight%2A> property will be larger due to the lack of borders.
## Examples
The following code example demonstrates how to create a <xref:System.Windows.Forms.Label> control that has a three-dimensional border and an image displayed using the <xref:System.Windows.Forms.Label.ImageList%2A> and <xref:System.Windows.Forms.Label.ImageIndex%2A> properties. The control also has a caption with a mnemonic character specified. The example code uses the <xref:System.Windows.Forms.Label.PreferredHeight%2A> and <xref:System.Windows.Forms.Label.PreferredWidth%2A> properties to properly size the <xref:System.Windows.Forms.Label> control on the form on which it is displayed. This example requires that an <xref:System.Windows.Forms.ImageList> has been created and named imageList1 and that it has loaded two images. The example also requires that the code is within a form that has the <xref:System.Drawing?displayProperty=nameWithType> namespace added to its code.
[!code-cpp[Classic Label Example#1](~/samples/snippets/cpp/VS_Snippets_Winforms/Classic Label Example/CPP/source.cpp#1)]
[!code-csharp[Classic Label Example#1](~/samples/snippets/csharp/VS_Snippets_Winforms/Classic Label Example/CS/source.cs#1)]
[!code-vb[Classic Label Example#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/Classic Label Example/VB/source.vb#1)]
]]></format>
</remarks>
<altmember cref="P:System.Windows.Forms.Label.PreferredWidth" />
<altmember cref="P:System.Windows.Forms.Label.AutoSize" />
</Docs>
</Member>
<Member MemberName="PreferredWidth">
<MemberSignature Language="C#" Value="public virtual int PreferredWidth { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance int32 PreferredWidth" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.Label.PreferredWidth" />
<MemberSignature Language="VB.NET" Value="Public Overridable ReadOnly Property PreferredWidth As Integer" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property int PreferredWidth { int get(); };" />
<MemberSignature Language="F#" Value="member this.PreferredWidth : int" Usage="System.Windows.Forms.Label.PreferredWidth" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.Browsable(false)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Advanced)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the preferred width of the control.</summary>
<value>The width of the control (in pixels), assuming a single line of text is displayed.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This property returns the length of the text string, but does not take line wrapping into consideration. For example, a text string that measures 300 pixels wide could be displayed as three lines in a <xref:System.Windows.Forms.Label> that is only 100 pixels wide. The <xref:System.Windows.Forms.Label.PreferredWidth%2A> property still returns 300 pixels. You can use this property, along with the <xref:System.Windows.Forms.Label.PreferredHeight%2A> property, to ensure that the text in the <xref:System.Windows.Forms.Label> control is displayed properly. You can use the <xref:System.Windows.Forms.Label.AutoSize%2A> property to automatically adjust the height and the width of the <xref:System.Windows.Forms.Label> control based on the text and font size.
> [!NOTE]
> If the <xref:System.Windows.Forms.Label.BorderStyle%2A> property of the <xref:System.Windows.Forms.Label> control is set to `BorderStyle.None`, the value returned by <xref:System.Windows.Forms.Label.PreferredWidth%2A> property will be larger due to the lack of borders.
## Examples
The following code example demonstrates how to create a <xref:System.Windows.Forms.Label> control that has a three-dimensional border and an image displayed using the <xref:System.Windows.Forms.Label.ImageList%2A> and <xref:System.Windows.Forms.Label.ImageIndex%2A> properties. The control also has a caption with a mnemonic character specified. The example code uses the <xref:System.Windows.Forms.Label.PreferredHeight%2A> and <xref:System.Windows.Forms.Label.PreferredWidth%2A> properties to properly size the <xref:System.Windows.Forms.Label> control on the form on which it is displayed. This example requires that an <xref:System.Windows.Forms.ImageList> has been created and named imageList1 and that it has loaded two images. The example also requires that the code is within a form that has the <xref:System.Drawing?displayProperty=nameWithType> namespace added to its code.
[!code-cpp[Classic Label Example#1](~/samples/snippets/cpp/VS_Snippets_Winforms/Classic Label Example/CPP/source.cpp#1)]
[!code-csharp[Classic Label Example#1](~/samples/snippets/csharp/VS_Snippets_Winforms/Classic Label Example/CS/source.cs#1)]
[!code-vb[Classic Label Example#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/Classic Label Example/VB/source.vb#1)]
]]></format>
</remarks>
<altmember cref="P:System.Windows.Forms.Label.PreferredHeight" />
<altmember cref="P:System.Windows.Forms.Label.AutoSize" />
</Docs>
</Member>
<Member MemberName="ProcessMnemonic">
<MemberSignature Language="C#" Value="protected internal override bool ProcessMnemonic (char charCode);" />
<MemberSignature Language="ILAsm" Value=".method familyorassemblyhidebysig virtual instance bool ProcessMnemonic(char charCode) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.Label.ProcessMnemonic(System.Char)" />
<MemberSignature Language="VB.NET" Value="Protected Friend Overrides Function ProcessMnemonic (charCode As Char) As Boolean" />
<MemberSignature Language="C++ CLI" Value="protected public:&#xA; override bool ProcessMnemonic(char charCode);" />
<MemberSignature Language="F#" Value="override this.ProcessMnemonic : char -&gt; bool" Usage="label.ProcessMnemonic charCode" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="charCode" Type="System.Char" />
</Parameters>
<Docs>
<param name="charCode">The character to process.</param>
<summary>Processes a mnemonic character.</summary>
<returns>
<see langword="true" /> if the character was processed as a mnemonic by the control; otherwise, <see langword="false" />.</returns>
<remarks>To be added.</remarks>
<permission cref="T:System.Security.Permissions.UIPermissionWindow">for access to all windows and user input events. Associated member: <see cref="F:System.Security.Permissions.UIPermissionWindow.AllWindows" /></permission>
</Docs>
</Member>
<Member MemberName="RenderTransparent">
<MemberSignature Language="C#" Value="protected virtual bool RenderTransparent { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool RenderTransparent" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.Label.RenderTransparent" />
<MemberSignature Language="VB.NET" Value="Protected Overridable Property RenderTransparent As Boolean" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; virtual property bool RenderTransparent { bool get(); void set(bool value); };" />
<MemberSignature Language="F#" Value="member this.RenderTransparent : bool with get, set" Usage="System.Windows.Forms.Label.RenderTransparent" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<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.Obsolete("This property has been deprecated. Use BackColor instead. http://go.microsoft.com/fwlink/?linkid=14202")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Indicates whether the container control background is rendered on the <see cref="T:System.Windows.Forms.Label" />.</summary>
<value>
<see langword="true" /> if the background of the <see cref="T:System.Windows.Forms.Label" /> control's container is rendered on the <see cref="T:System.Windows.Forms.Label" />; otherwise, <see langword="false" />. The default is <see langword="false" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Classes that inherit from `Label` can override this method to determine whether the derived control background will be rendered transparently on the form on which the control is drawn.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="RescaleConstantsForDpi">
<MemberSignature Language="C#" Value="protected override void RescaleConstantsForDpi (int deviceDpiOld, int deviceDpiNew);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig virtual instance void RescaleConstantsForDpi(int32 deviceDpiOld, int32 deviceDpiNew) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.Label.RescaleConstantsForDpi(System.Int32,System.Int32)" />
<MemberSignature Language="VB.NET" Value="Protected Overrides Sub RescaleConstantsForDpi (deviceDpiOld As Integer, deviceDpiNew As Integer)" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; override void RescaleConstantsForDpi(int deviceDpiOld, int deviceDpiNew);" />
<MemberSignature Language="F#" Value="override this.RescaleConstantsForDpi : int * int -&gt; unit" Usage="label.RescaleConstantsForDpi (deviceDpiOld, deviceDpiNew)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="deviceDpiOld" Type="System.Int32" Index="0" FrameworkAlternate="netframework-4.8" />
<Parameter Name="deviceDpiNew" Type="System.Int32" Index="1" FrameworkAlternate="netframework-4.8" />
</Parameters>
<Docs>
<param name="deviceDpiOld">The DPI value prior to the change.</param>
<param name="deviceDpiNew">The DPI value after the change.</param>
<summary>Provides constants for rescaling the control when a DPI change occurs.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="SetBoundsCore">
<MemberSignature Language="C#" Value="protected override void SetBoundsCore (int x, int y, int width, int height, System.Windows.Forms.BoundsSpecified specified);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig virtual instance void SetBoundsCore(int32 x, int32 y, int32 width, int32 height, valuetype System.Windows.Forms.BoundsSpecified specified) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.Label.SetBoundsCore(System.Int32,System.Int32,System.Int32,System.Int32,System.Windows.Forms.BoundsSpecified)" />
<MemberSignature Language="VB.NET" Value="Protected Overrides Sub SetBoundsCore (x As Integer, y As Integer, width As Integer, height As Integer, specified As BoundsSpecified)" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; override void SetBoundsCore(int x, int y, int width, int height, System::Windows::Forms::BoundsSpecified specified);" />
<MemberSignature Language="F#" Value="override this.SetBoundsCore : int * int * int * int * System.Windows.Forms.BoundsSpecified -&gt; unit" Usage="label.SetBoundsCore (x, y, width, height, specified)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="x" Type="System.Int32" />
<Parameter Name="y" Type="System.Int32" />
<Parameter Name="width" Type="System.Int32" />
<Parameter Name="height" Type="System.Int32" />
<Parameter Name="specified" Type="System.Windows.Forms.BoundsSpecified" />
</Parameters>
<Docs>
<param name="x">The new <see cref="P:System.Windows.Forms.Control.Left" /> property value of the control.</param>
<param name="y">The new <see cref="P:System.Windows.Forms.Control.Top" /> property value of the control.</param>
<param name="width">The new <see cref="P:System.Windows.Forms.Control.Width" /> property value of the control.</param>
<param name="height">The new <see cref="P:System.Windows.Forms.Control.Height" /> property value of the control.</param>
<param name="specified">A bitwise combination of the <see cref="T:System.Windows.Forms.BoundsSpecified" /> values. For any parameter not specified, the current value will be used.</param>
<summary>Sets the specified bounds of the label.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
If you set the <xref:System.Windows.Forms.Label.AutoSize%2A> property to `true`, the label will be sized to fit the contents of the label. If you set <xref:System.Windows.Forms.Label.AutoSize%2A> to `false` after calling the <xref:System.Windows.Forms.Label.SetBoundsCore%2A> method, the label will receive the dimensions you specified in the call.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="TabStop">
<MemberSignature Language="C#" Value="public bool TabStop { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool TabStop" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.Label.TabStop" />
<MemberSignature Language="VB.NET" Value="Public Property TabStop As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property bool TabStop { bool get(); void set(bool value); };" />
<MemberSignature Language="F#" Value="member this.TabStop : bool with get, set" Usage="System.Windows.Forms.Label.TabStop" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.Browsable(false)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.DefaultValue(false)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets a value indicating whether the user can tab to the <see cref="T:System.Windows.Forms.Label" />. This property is not used by this class.</summary>
<value>This property is not used by this class. The default is <see langword="false" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Windows.Forms.Label.TabStop%2A> property is not relevant for the <xref:System.Windows.Forms.Label> class, so setting <xref:System.Windows.Forms.Label.TabStop%2A> to `true` has no effect.
]]></format>
</remarks>
<altmember cref="T:System.Windows.Forms.LinkLabel" />
</Docs>
</Member>
<Member MemberName="TabStopChanged">
<MemberSignature Language="C#" Value="public event EventHandler TabStopChanged;" />
<MemberSignature Language="ILAsm" Value=".event class System.EventHandler TabStopChanged" />
<MemberSignature Language="DocId" Value="E:System.Windows.Forms.Label.TabStopChanged" />
<MemberSignature Language="VB.NET" Value="Public Custom Event TabStopChanged As EventHandler " />
<MemberSignature Language="C++ CLI" Value="public:&#xA; event EventHandler ^ TabStopChanged;" />
<MemberSignature Language="F#" Value="member this.TabStopChanged : EventHandler " Usage="member this.TabStopChanged : System.EventHandler " />
<MemberType>Event</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.Browsable(false)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.EventHandler</ReturnType>
</ReturnValue>
<Docs>
<summary>Occurs when the <see cref="P:System.Windows.Forms.Label.TabStop" /> property changes.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This event is not relevant for this class.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="Text">
<MemberSignature Language="C#" Value="public override string Text { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance string Text" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.Label.Text" />
<MemberSignature Language="VB.NET" Value="Public Overrides Property Text As String" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property System::String ^ Text { System::String ^ get(); void set(System::String ^ value); };" />
<MemberSignature Language="F#" Value="member this.Text : string with get, set" Usage="System.Windows.Forms.Label.Text" />
<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;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.Editor("System.ComponentModel.Design.MultilineStringEditor, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(System.Drawing.Design.UITypeEditor))</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.ComponentModel.SettingsBindable(true)</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5">
<AttributeName>System.ComponentModel.Editor("System.ComponentModel.Design.MultilineStringEditor, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(System.Drawing.Design.UITypeEditor))</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the text associated with this control.</summary>
<value>The text associated with this control.</value>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="TextAlign">
<MemberSignature Language="C#" Value="public virtual System.Drawing.ContentAlignment TextAlign { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.Drawing.ContentAlignment TextAlign" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.Label.TextAlign" />
<MemberSignature Language="VB.NET" Value="Public Overridable Property TextAlign As ContentAlignment" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property System::Drawing::ContentAlignment TextAlign { System::Drawing::ContentAlignment get(); void set(System::Drawing::ContentAlignment value); };" />
<MemberSignature Language="F#" Value="member this.TextAlign : System.Drawing.ContentAlignment with get, set" Usage="System.Windows.Forms.Label.TextAlign" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.Localizable(true)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.DefaultValue(Mono.Cecil.CustomAttributeArgument)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Drawing.ContentAlignment</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the alignment of text in the label.</summary>
<value>One of the <see cref="T:System.Drawing.ContentAlignment" /> values. The default is <see cref="F:System.Drawing.ContentAlignment.TopLeft" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
You can use this property to align the text within a label to match the layout of controls on your form. For example, if your controls are located to the right edge of the labels, you can set the <xref:System.Windows.Forms.Label.TextAlign%2A> property to one of the right-aligned horizontal alignments (<xref:System.Drawing.ContentAlignment.TopRight>, <xref:System.Drawing.ContentAlignment.MiddleRight>, <xref:System.Drawing.ContentAlignment.BottomRight>) and the text will be aligned with the right edge of the labels to align with your controls.
]]></format>
</remarks>
<exception cref="T:System.ComponentModel.InvalidEnumArgumentException">The value assigned is not one of the <see cref="T:System.Drawing.ContentAlignment" /> values.</exception>
<altmember cref="T:System.Drawing.ContentAlignment" />
</Docs>
</Member>
<Member MemberName="TextAlignChanged">
<MemberSignature Language="C#" Value="public event EventHandler TextAlignChanged;" />
<MemberSignature Language="ILAsm" Value=".event class System.EventHandler TextAlignChanged" />
<MemberSignature Language="DocId" Value="E:System.Windows.Forms.Label.TextAlignChanged" />
<MemberSignature Language="VB.NET" Value="Public Custom Event TextAlignChanged As EventHandler " />
<MemberSignature Language="C++ CLI" Value="public:&#xA; event EventHandler ^ TextAlignChanged;" />
<MemberSignature Language="F#" Value="member this.TextAlignChanged : EventHandler " Usage="member this.TextAlignChanged : System.EventHandler " />
<MemberType>Event</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.EventHandler</ReturnType>
</ReturnValue>
<Docs>
<summary>Occurs when the value of the <see cref="P:System.Windows.Forms.Label.TextAlign" /> property has changed.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
For more information about handling events, see [Handling and Raising Events](~/docs/standard/events/index.md).
## Examples
The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.Label.TextAlignChanged> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>.
To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.Label> named Label1. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.Label.TextAlignChanged> event.
[!code-csharp[System.Windows.Forms.EventExamples#459](~/samples/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/CS/EventExamples.cs#459)]
[!code-vb[System.Windows.Forms.EventExamples#459](~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb#459)]
]]></format>
</remarks>
<altmember cref="P:System.Windows.Forms.Label.TextAlign" />
<altmember cref="M:System.Windows.Forms.Label.OnTextAlignChanged(System.EventArgs)" />
</Docs>
</Member>
<Member MemberName="ToString">
<MemberSignature Language="C#" Value="public override string ToString ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance string ToString() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.Label.ToString" />
<MemberSignature Language="VB.NET" Value="Public Overrides Function ToString () As String" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; override System::String ^ ToString();" />
<MemberSignature Language="F#" Value="override this.ToString : unit -&gt; string" Usage="label.ToString " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Returns a string that represents the current <see cref="T:System.Windows.Forms.Label" />.</summary>
<returns>A string that represents the current <see cref="T:System.Windows.Forms.Label" />.</returns>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="UseCompatibleTextRendering">
<MemberSignature Language="C#" Value="public bool UseCompatibleTextRendering { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool UseCompatibleTextRendering" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.Label.UseCompatibleTextRendering" />
<MemberSignature Language="VB.NET" Value="Public Property UseCompatibleTextRendering As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property bool UseCompatibleTextRendering { bool get(); void set(bool value); };" />
<MemberSignature Language="F#" Value="member this.UseCompatibleTextRendering : bool with get, set" Usage="System.Windows.Forms.Label.UseCompatibleTextRendering" />
<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-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.ComponentModel.DefaultValue(false)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets a value that determines whether to use the <see cref="T:System.Drawing.Graphics" /> class ([!INCLUDE[ndptecgdiplus](~/includes/ndptecgdiplus-md.md)]) or the <see cref="T:System.Windows.Forms.TextRenderer" /> class ([!INCLUDE[ndptecgdi](~/includes/ndptecgdi-md.md)]) to render text.</summary>
<value>
<see langword="true" /> if the <see cref="T:System.Drawing.Graphics" /> class should be used to perform text rendering for compatibility with versions 1.0 and 1.1. of the .NET Framework; otherwise, <see langword="false" />. The default is <see langword="false" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The `UseCompatibleTextRendering` property is intended to provide visual compatibility between Windows Forms controls that render text using the <xref:System.Windows.Forms.TextRenderer> class and [!INCLUDE[net_v10_short](~/includes/net-v10-short-md.md)] and [!INCLUDE[net_v11_short](~/includes/net-v11-short-md.md)] applications that perform custom text rendering using the <xref:System.Drawing.Graphics> class. In most cases, if your application is not being upgraded from [!INCLUDE[net_v10_short](~/includes/net-v10-short-md.md)] or [!INCLUDE[net_v11_short](~/includes/net-v11-short-md.md)], it is recommended that you leave `UseCompatibleTextRendering` set to the default value of `false`.
The [!INCLUDE[ndptecgdi](~/includes/ndptecgdi-md.md)] based <xref:System.Windows.Forms.TextRenderer> class was introduced in the [!INCLUDE[dnprdnlong](~/includes/dnprdnlong-md.md)] to improve performance, make text look better, and improve support for international fonts. In earlier versions of the [!INCLUDE[dnprdnshort](~/includes/dnprdnshort-md.md)], the [!INCLUDE[ndptecgdiplus](~/includes/ndptecgdiplus-md.md)] based <xref:System.Drawing.Graphics> class was used to perform all text rendering. [!INCLUDE[ndptecgdi](~/includes/ndptecgdi-md.md)] calculates character spacing and word wrapping differently from [!INCLUDE[ndptecgdiplus](~/includes/ndptecgdiplus-md.md)]. In a Windows Forms application that uses the <xref:System.Drawing.Graphics> class to render text, this could cause the text for controls that use <xref:System.Windows.Forms.TextRenderer> to appear different from the other text in the application. To resolve this incompatibility, you can set the `UseCompatibleTextRendering` property to `true` for a specific control. To set `UseCompatibleTextRendering` to `true` for all supported controls in the application, call the <xref:System.Windows.Forms.Application.SetCompatibleTextRenderingDefault%2A?displayProperty=nameWithType> method with a parameter of `true`.
]]></format>
</remarks>
<altmember cref="M:System.Windows.Forms.Application.SetCompatibleTextRenderingDefault(System.Boolean)" />
<altmember cref="P:Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.UseCompatibleTextRendering" />
</Docs>
</Member>
<Member MemberName="UseMnemonic">
<MemberSignature Language="C#" Value="public bool UseMnemonic { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool UseMnemonic" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.Label.UseMnemonic" />
<MemberSignature Language="VB.NET" Value="Public Property UseMnemonic As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property bool UseMnemonic { bool get(); void set(bool value); };" />
<MemberSignature Language="F#" Value="member this.UseMnemonic : bool with get, set" Usage="System.Windows.Forms.Label.UseMnemonic" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<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 the control interprets an ampersand character (&amp;) in the control's <see cref="P:System.Windows.Forms.Control.Text" /> property to be an access key prefix character.</summary>
<value>
<see langword="true" /> if the label doesn't display the ampersand character and underlines the character after the ampersand in its displayed text and treats the underlined character as an access key; otherwise, <see langword="false" /> if the ampersand character is displayed in the text of the control. The default is <see langword="true" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
If the <xref:System.Windows.Forms.Label.UseMnemonic%2A> property is set to `true` and a mnemonic character (a character preceded by the ampersand) is defined in the <xref:System.Windows.Forms.Control.Text%2A> property of the <xref:System.Windows.Forms.Label>, pressing ALT+ the mnemonic character sets the focus to the control that follows the <xref:System.Windows.Forms.Label> in the tab order. You can use this property to provide proper keyboard navigation to the controls on your form.
## Examples
The following code example demonstrates how to create a <xref:System.Windows.Forms.Label> control that has a three-dimensional border and an image displayed using the <xref:System.Windows.Forms.Label.ImageList%2A> and <xref:System.Windows.Forms.Label.ImageIndex%2A> properties. The control also has a caption with a mnemonic character specified. The example code uses the <xref:System.Windows.Forms.Label.PreferredHeight%2A> and <xref:System.Windows.Forms.Label.PreferredWidth%2A> properties to properly size the <xref:System.Windows.Forms.Label> control on the form on which it is displayed. This example requires that an <xref:System.Windows.Forms.Label.ImageList%2A> has been created and named imageList1 and that it has loaded two images. The example also requires that the code is within a form that has the <xref:System.Drawing> namespace added to its code.
[!code-cpp[Classic Label Example#1](~/samples/snippets/cpp/VS_Snippets_Winforms/Classic Label Example/CPP/source.cpp#1)]
[!code-csharp[Classic Label Example#1](~/samples/snippets/csharp/VS_Snippets_Winforms/Classic Label Example/CS/source.cs#1)]
[!code-vb[Classic Label Example#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/Classic Label Example/VB/source.vb#1)]
]]></format>
</remarks>
<altmember cref="P:System.Windows.Forms.Control.Text" />
</Docs>
</Member>
<Member MemberName="WndProc">
<MemberSignature Language="C#" Value="protected override void WndProc (ref System.Windows.Forms.Message m);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig virtual instance void WndProc(valuetype System.Windows.Forms.Message&amp; m) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.Label.WndProc(System.Windows.Forms.Message@)" />
<MemberSignature Language="VB.NET" Value="Protected Overrides Sub WndProc (ByRef m As Message)" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; override void WndProc(System::Windows::Forms::Message % m);" />
<MemberSignature Language="F#" Value="override this.WndProc : -&gt; unit" Usage="label.WndProc m" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="m" Type="System.Windows.Forms.Message" RefType="ref" />
</Parameters>
<Docs>
<param name="m">The Windows <see cref="T:System.Windows.Forms.Message" /> to process.</param>
<summary>Processes Windows messages.</summary>
<remarks>To be added.</remarks>
<permission cref="T:System.Security.Permissions.SecurityPermission">for operating with unmanaged code. Associated enumeration: <see cref="F:System.Security.Permissions.SecurityPermissionFlag.UnmanagedCode" /></permission>
</Docs>
</Member>
</Members>
</Type>
You can’t perform that action at this time.