O'Reilly logo

Windows Forms Programming in C# by Chris Sells

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Standard Controls

The basic unit of the user interface in WinForms is the control. Everything that interacts directly with the user in a region defined by a container is an instance of an object that derives, directly or indirectly, from the System.Windows.Forms.Control class.

Non-Container Controls

Non-container controls are those that don't contain other controls.

Label

The Label control, shown in Figure D.13, holds literal text that is meant to be informative to the user. For example, in a typical application, labels are displayed near text boxes to inform the user what the text box contains. Text inside a label wraps to the width of the label. The label text can be aligned to any side or corner of the control.

// Label
label1.Text = "This ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required