System.Windows.Forms.Label Members

The members of System.Windows.Forms.Label are listed below.

See Also: Inherited members from System.Windows.Forms.Control

Public Constructors

Initializes a new instance of the System.Windows.Forms.Label class.

Public Properties

AutoEllipsisbool.

Gets or sets a value indicating whether the ellipsis character (...) appears at the right edge of the System.Windows.Forms.Label, denoting that the System.Windows.Forms.Label text extends beyond the specified length of the System.Windows.Forms.Label.

override
AutoSizebool.

Gets or sets a value indicating whether the control is automatically resized to display its entire contents.

override
BackgroundImageSystem.Drawing.Image.

Gets or sets the image rendered on the background of the control.

override
BackgroundImageLayoutImageLayout.

This property is not relevant for this class.

BorderStyleBorderStyle.

Gets or sets the border style for the control.

FlatStyleFlatStyle.

Gets or sets the flat style appearance of the label control.

ImageSystem.Drawing.Image.

Gets or sets the image that is displayed on a System.Windows.Forms.Label.

ImageAlignSystem.Drawing.ContentAlignment.

Gets or sets the alignment of an image that is displayed in the control.

ImageIndexint.

Gets or sets the index value of the image displayed on the System.Windows.Forms.Label.

ImageKeystring.

Gets or sets the key accessor for the image in the Label.ImageList.

ImageListImageList.

Gets or sets the System.Windows.Forms.ImageList that contains the images to display in the System.Windows.Forms.Label control.

ImeModeImeMode.

Gets or sets the Input Method Editor (IME) mode supported by this control.

[read-only]
PreferredHeightint.

Gets the preferred height of the control.

[read-only]
PreferredWidthint.

Gets the preferred width of the control.

TabStopbool.

Gets or sets a value indicating whether the user can tab to the System.Windows.Forms.Label. This property is not used by this class.

override
Textstring.

Gets or sets the text associated with this control.

TextAlignSystem.Drawing.ContentAlignment.

Gets or sets the alignment of text in the label.

UseCompatibleTextRenderingbool.

Gets or sets a value that determines whether to use the System.Drawing.Graphics class (ndptecgdiplus) or the System.Windows.Forms.TextRenderer class (ndptecgdi) to render text.

UseMnemonicbool.

Gets or sets a value indicating whether the control interprets an ampersand character (&) in the control's Control.Text property to be an access key prefix character.

Protected Properties

[read-only]
override
CreateParamsCreateParams.

Gets the required creation parameters when the control handle is created.

[read-only]
override
DefaultImeModeImeMode.

Gets the default Input Method Editor (IME) mode supported by this control.

[read-only]
override
DefaultMarginPadding.

Gets the space, in pixels, that is specified by default between controls.

[read-only]
override
DefaultSizeSystem.Drawing.Size.

Gets the default size of the control.

RenderTransparentbool.

Indicates whether the container control background is rendered on the System.Windows.Forms.Label.

Public Methods

override
GetPreferredSize(System.Drawing.Size) : System.Drawing.Size

Retrieves the size of a rectangular area into which a control can be fitted.

override
ToString() : string

Returns a string that represents the current System.Windows.Forms.Label.

Protected Methods

CalcImageRenderBounds(System.Drawing.Image, System.Drawing.Rectangle, System.Drawing.ContentAlignment) : System.Drawing.Rectangle

Determines the size and location of an image drawn within the System.Windows.Forms.Label control based on the alignment of the control.

override
CreateAccessibilityInstance() : AccessibleObject

Creates a new accessibility object for the control.

override
Dispose(bool)

Releases the unmanaged resources used by the System.Windows.Forms.Label and optionally releases the managed resources.

DrawImage(System.Drawing.Graphics, System.Drawing.Image, System.Drawing.Rectangle, System.Drawing.ContentAlignment)

Draws an System.Drawing.Image within the specified bounds.

OnAutoSizeChanged(EventArgs)
Documentation for this section has not yet been entered.
override
OnEnabledChanged(EventArgs)

Raises the Control.EnabledChanged event.

override
OnFontChanged(EventArgs)

Raises the Control.FontChanged event.

override
OnHandleDestroyed(EventArgs)

Raises the Control.HandleDestroyed event.

override
OnMouseEnter(EventArgs)

Raises the Control.MouseEnter event.

override
OnMouseLeave(EventArgs)

Raises the Control.MouseLeave event.

override
OnPaddingChanged(EventArgs)

Raises the Control.PaddingChanged event.

override
OnPaint(PaintEventArgs)

Raises the Control.Paint event.

override
OnParentChanged(EventArgs)

Raises the Control.ParentChanged event.

override
OnRightToLeftChanged(EventArgs)

Raises the Control.RightToLeftChanged event.

OnTextAlignChanged(EventArgs)

Raises the Label.TextAlignChanged event.

override
OnTextChanged(EventArgs)

Raises the Control.TextChanged event.

override
OnVisibleChanged(EventArgs)

Raises the Control.VisibleChanged event.

override
ProcessMnemonic(char) : bool

Processes a mnemonic character.

override
SetBoundsCore(int, int, int, int, BoundsSpecified)

Sets the specified bounds of the label.

override
WndProc(ref Message)
Documentation for this section has not yet been entered.

Public Events

AutoSizeChanged

Occurs when the value of the Label.AutoSize property changes.

BackgroundImageChanged

Occurs when the Label.BackgroundImage property changes.

BackgroundImageLayoutChanged

Occurs when the Label.BackgroundImageLayout property changes.

ImeModeChanged

Occurs when the Label.ImeMode property changes.

KeyDown

Occurs when the user presses a key while the label has focus.

KeyPress

Occurs when the user presses a key while the label has focus.

KeyUp

Occurs when the user releases a key while the label has focus.

TabStopChanged

Occurs when the Label.TabStop property changes.

TextAlignChanged

Occurs when the value of the Label.TextAlign property has changed.