ListView.StateImageList ListView.StateImageList ListView.StateImageList 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


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.


属性允许你ImageList指定,其中包含用于表示ListView控件中的项的应用程序特定状态的图像。 StateImageListThe 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.

ImageList true CheckBoxes如果在属性中指定了并将属性设置为,则将显示中索引位置0和1之间的图像,而不是复选框。 StateImageList ImageListIf 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.