System.Windows.Forms.ButtonBase.ImageList Property

Gets or sets the System.Windows.Forms.ImageList that contains the System.Drawing.Image displayed on a button control.

Syntax

[System.ComponentModel.RefreshProperties(System.ComponentModel.RefreshProperties.Repaint)]
[System.ComponentModel.DefaultValue(null)]
public ImageList ImageList { set; get; }

Value

Documentation for this section has not yet been entered.

Remarks

When the ButtonBase.ImageList or ButtonBase.ImageIndex property is set, the ButtonBase.Image property is set null, which is its default value.

Note:

If the ButtonBase.ImageList property value is changed to null, the ButtonBase.ImageIndex property returns its default value, -1. However, the assigned ButtonBase.ImageIndex value is retained internally and used when another System.Windows.Forms.ImageList is assigned to the ButtonBase.ImageList property. If the new System.Windows.Forms.ImageList assigned to the ButtonBase.ImageList property has an System.Windows.Forms.ImageList.ImageCollection.Count property value that is less than or equal to the value assigned to the ButtonBase.ImageIndex property minus one (because the collection is a zero-based index), the ButtonBase.ImageIndex property value is adjusted to one less than the System.Windows.Forms.ImageList.ImageCollection.Count property value. For example, consider a button control whose System.Windows.Forms.ImageList has three images and whose ButtonBase.ImageIndex property is set to 2. If a new System.Windows.Forms.ImageList that has only two images is assigned to the button, the ButtonBase.ImageIndex value changes to 1.

Requirements

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0