Label Constructor
Collapse the table of content
Expand the table of content

Label Constructor ()

 

Initializes a new instance of the Label class.

Namespace:   System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

new : unit -> Label

By default, a label is displayed with its AutoSize property set to false and with its BorderStyle property set to BorderStyle.None.

The following code example demonstrates how to create a Label control that has a three-dimensional border and an image displayed using the ImageList and ImageIndex properties. The control also has a caption with a mnemonic character specified. The example code uses the PreferredHeight and PreferredWidth properties to properly size the Label control on the form on which it is displayed. This example requires that an ImageList has been created and named imageList1 and that it has loaded two images. The example also requires that the code is within a form that has the System.Drawing namespace added to its code.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 1.1
Return to top
Show:
© 2016 Microsoft