Gets or sets the alignment of an image that is displayed in the control.
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
This property enables you to align an image within the boundaries of the Label control to ensure that the image is properly displayed. You can add an image to a Label using the Image property or the ImageList and ImageIndex properties. Images displayed in the control cannot be stretched or shrunk to fill the control if the control is larger or smaller than the image.
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.
Available since 1.1