Image Property

ButtonBase.Image Property

 

Gets or sets the image that is displayed on a button control.

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

member Image : Image with get, set

Property Value

Type: System.Drawing.Image

The Image displayed on the button control. The default value is null.

When the Image property is set, the ImageList property will be set to null, and the ImageIndex property will be set to its default, -1.

System_CAPS_noteNote

If the FlatStyle property is set to FlatStyle.System, any images assigned to the Image property are not displayed.

The following code example uses the derived class, Button and sets some of its common properties. The result will be a flat button with text on the left and an image on the right. This code requires that you have a bitmap image named MyBitMap.bmp stored in the C:\Graphics directory, and that a reference to the System.Drawing namespace is included.

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