Represents a standard Windows label, which displays a string of text that the user cannot edit.
Object
MarshalByRefObject
MarshalByRefComponent
Control
RichControl
FormatControl
Label
[Visual Basic] Public Class Label Inherits FormatControl [C#] public class Label : FormatControl [C++] public __gc class Label : public FormatControl [JScript] public class Label extends FormatControl
Labels are used in many instances and for many purposes. Most commonly, they are used to label controls that don't have their own Caption properties. For example, you can use a label to add descriptive text for text boxes, list boxes, combo boxes, and so on. They can also be used to add descriptive text to a form to provide the user with helpful information.
You can also write code that changes the text displayed by a Label in response to events at run time. For example, if your application takes a few minutes to process a change, you can display a processing-status message in a label.
A Label participates in the tab order but does not receive focus. When a user presses the label's shortcut key, focus moves to the next control in the tab order.
CAUTION A Label can be transparent, meaning that it uses the surface of its container as its background. When you use a transparent label, use only the current device coordinate system to draw on the container, or the Label background may paint improperly.
Namespace: System.WinForms
Assembly: System.WinForms.dll
Label Members | System.WinForms Namespace | Control | TextBox