You can easily use the images from the ImageList to add images to each item in the dropdown list of a C1ComboBox control.
To add images to C1ComboBoxItems at Design time, complete the following:
To add images to C1ComboBoxItems at Run time, add the following code:
To write code in Visual Basic
Visual Basic |
Copy Code
|
---|---|
c1ComboBox1.ItemsImageList = imageList imageList.Images.Add("First item", Image.FromFile("First.png")) c1ComboBox1.Items.Add("First item") |
To write code in C#
C# |
Copy Code
|
---|---|
c1ComboBox1.ItemsImageList = imageList; imageList.Images.Add("First item", Image.FromFile("First.png")); c1ComboBox1.Items.Add("First item"); |