Label (lbl)
![]() | Label - Allows you to display text to the user. |
Examples
![]() |
AutoSize if True by default.
Doesn't Accept Ampersand (&)
A single ampersand is not displayed. You must use a double ampersand.
Alternatively you could use the "UseMnemonice" property
Group Box also does not display single ampersand
Useful Code
Label1.Text = "some text"
Properties
AutoEllipsis | Gets or sets a value indicating whether the ellipsis character (...) appears at the right edge of the Label, denoting that the Label text extends beyond the specified length of the Label. |
AutoSize | Overridden. Gets or sets a value indicating whether the control is automatically resized to display its entire contents. |
BorderStyle | Gets or sets the border style for the control. |
DefaultSize | Overridden. |
FlatStyle | Gets or sets the flat style appearance of the label control. |
Image | Gets or sets the image that is displayed on a Label. |
ImageAlign | Gets or sets the alignment of an image that is displayed in the control. |
ImageIndex | Gets or sets the index value of the image displayed on the Label. |
ImageKey | Gets or sets the key accessor for the image in the ImageList. |
ImageList | Gets or sets the ImageList that contains the images to display in the Label control. |
PreferredHeight | Gets the preferred height of the control. |
PreferredWidth | Gets the preferred width of the control. |
RenderTransparent | Indicates whether the container control background is rendered on the Label. |
Text | Overridden. |
TextAlign | Gets or sets the alignment of text in the label. |
UseCompatibleTextRendering | Gets or sets a value that specifies whether text rendering should be compatible with previous releases of Windows Forms. |
UseMnemonic | Gets or sets a value indicating whether the control interprets an ampersand character (&) in the control's Text property to be an access key prefix character. |
Methods
Dispose | Overloaded. Releases the resources used by the Label. |
GetPreferredSize | Overridden. |
CalcImageRenderBounds | Determines the size and location of an image drawn within the Label control based on the alignment of the control. |
DrawImage | Draws an Image within the specified bounds. |
Events
AutoSizeChanged | Occurs when the value of the AutoSize property changes. |
BackgroundImageChanged | Occurs when the BackgroundImage property changes. |
BackgroundImageLayoutChanged | Occurs when the BackgroundImageLayout property changes. |
© 2023 Better Solutions Limited. All Rights Reserved. © 2023 Better Solutions Limited TopPrevNext