Displaying Static Text with the Label Control

Label controls are used to display static text to the user. By static, I mean that the user can't change the text directly (but you can change the text with code). Label controls are one of the most common controls used; fortunately, they're also one of the easiest. Labels are most often used to provide descriptive text for other controls, such as text boxes. Labels are also great for providing status-type information to a user, as well as for providing general instructions on a form.

Begin by creating a new Windows Application named Text Controls. Change the name of the default form to fclsControls, and change its Text property to Text Controls Example. Next, change the Main() entry point to use ...

Get Sams Teach Yourself Microsoft® Visual C#™ .NET in 24 Hours now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.