ListView.StateImageList Property


获取或设置与控件中应用程序定义的状态相关的 ImageListGets or sets the ImageList associated with application-defined states in the control.

 property System::Windows::Forms::ImageList ^ StateImageList { System::Windows::Forms::ImageList ^ get(); void set(System::Windows::Forms::ImageList ^ value); };
public System.Windows.Forms.ImageList StateImageList { get; set; }
member this.StateImageList : System.Windows.Forms.ImageList with get, set
Public Property StateImageList As ImageList

Property Value


ImageList,包含一组状态图像,这些图像可用于指示项的应用程序定义的状态。An ImageList that contains a set of state images that can be used to indicate an application-defined state of an item. 默认为 nullThe default is null.


StateImageList 属性允许您指定一个 ImageList,其中包含用于表示 ListView 控件中某个项的应用程序特定状态的图像。The StateImageList property allows you to specify an ImageList that contains images to use to represent an application-specific state of an item in a ListView control. 状态图像显示在该项的图标的左侧。State images are displayed to the left of an icon for the item. 您可以使用状态图像(如选中和未选中的复选框)来指示应用程序定义的项状态。You can use state images, such as checked and unchecked check boxes, to indicate application-defined item states. 状态图像在 ListView 控件的所有视图中可见。State images are visible in all views of the ListView control.

如果在 StateImageList 属性中指定了 ImageList,并且 CheckBoxes 属性设置为 true,则将显示 ImageList 中索引位置0和1之间的图像,而不是复选框。If an ImageList is specified in the StateImageList property and the CheckBoxes property is set to true, the images at index positions 0 and 1 in the ImageList are displayed instead of the check box. 显示位于索引位置0的图像而不是未选中的复选框,并显示索引位置1处的图像而不是选中的复选框。The image at index position 0 is displayed instead of the unchecked check box, and the image at index position 1 is displayed instead of the checked check box.

Applies to

See also