ImageList.ColorDepth ImageList.ColorDepth ImageList.ColorDepth ImageList.ColorDepth Property

Definition

Gets the color depth of the image list.

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

Property Value

The number of available colors for the image. In the .NET Framework version 1.0, the default is Depth4Bit. In the .NET Framework version 1.1 or later, the default is Depth8Bit.

Exceptions

Remarks

When you set the color depth to a new value, the Handle for the image list is recreated. Because setting the ColorDepth property causes the handle to be recreated, you should set ColorDepth prior to setting the Images property. When the handle for the ImageList has been created, setting the ColorDepth or ImageSize properties in code, after setting the Images property, will cause the collection of images set for the Images property to be deleted.

Applies to

See also