Files
docs-desktop/dotnet-desktop-guide/net/winforms/controls/labels.md
T
Andy De GeorgeandGenevieve Warren 184e6c9a0c Initial publish of WinForms for .NET 5. (#96)
* Migrate inprogress winforms contnet from docs

* Fix preview note

* Fix vb code

* Minor fixes to keyboard articles

* Minor adjustment to overview

* Test redirects for 4.0 -> 5.0

* adjust links

* Add mouse input section winforms (#81)

* Update projects to .NET 5

* Update keyboard desc

* Finish mouse events

* Add remaining mouse articles;code

* finish mouse input

* minor fixes

* Remove branch restriction (#82)

* Update build-validation.yml (#84)

* Update build-validation.yml (#85)

* Fix vb proj

* Add WinForms tutorial (#91)

* redirect between overview

* New create an app tutorial

* Fix markdown

* Fix preserve view setting

* Add forms articles (#93)

* Add forms articles

* Fix warnings

* Winforms publish (#95)

* Prep TOC for publish

* Updated date

* Automatic how-to topic type

* Update desc/headers

* Fix links

* Fix build errors

* Add preview note

* Update toc landing page

* Convert old style project files

* update download links

* Apply suggestions from code review

Co-authored-by: Genevieve Warren <[email protected]>

* Adjust number key

* Update dotnet-desktop-guide/net/winforms/overview/index.md

* Try toc position task via bookmark

* Improve images

* Remove sentence

* File redirects

Co-authored-by: Genevieve Warren <[email protected]>
2020-10-28 10:44:16 -07:00

2.2 KiB

title, description, ms.date, ms.topic, f1_keywords, helpviewer_keywords
title description ms.date ms.topic f1_keywords helpviewer_keywords
Label control Learn about the Label control in Windows Forms for .NET. Labels are used to identify visual elements to the user. 10/26/2020 overview
Label
images [Windows Forms], displaying in labels
labels
Label control [Windows Forms], about Label control

Label control overview (Windows Forms .NET)

Windows Forms xref:System.Windows.Forms.Label controls are used to display text that cannot be edited by the user. They're used to identify objects on a form and to provide a description of what a certain control represents or does. For example, you can use labels to add descriptive captions to text boxes, list boxes, combo boxes, and so on. You can also write code that changes the text displayed by a label in response to events at run time.

[!INCLUDE desktop guide under construction]

Working with the Label Control

Because the xref:System.Windows.Forms.Label control can't receive focus, it can be used to create access keys for other controls. An access key allows a user to focus the next control in tab order by pressing the Alt key with the chosen access key. For more information, see Use a label to focus a control.

The caption displayed in the label is contained in the xref:System.Windows.Forms.Label.Text%2A property. The xref:System.Windows.Forms.Label.TextAlign%2A property allows you to set the alignment of the text within the label. For more information, see How to: Set the Text Displayed by a Windows Forms Control.

See also