[]
        
(Showing Draft Content)

Adding Images to Items in the ComboBox

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:

  1. Add the C1ComboBox control to your form.
  2. Add items to C1ComboBox.Items collection using the String Collection Editor.
  3. Add the ImageList control to your form.
  4. Add images to the imageList1.
  5. Set keys (Name) of the images equal to the items in C1ComboBox.Items.

To add images to C1ComboBoxItems at Run time, add the following code:

To write code in Visual Basic

c1ComboBox1.ItemsImageList = imageList
                    imageList.Images.Add("First item", Image.FromFile("First.png"))
                    c1ComboBox1.Items.Add("First item")

To write code in C#

c1ComboBox1.ItemsImageList = imageList;
                    imageList.Images.Add("First item", Image.FromFile("First.png"));
                    c1ComboBox1.Items.Add("First item");

See Also

Adding Items to C1ComboBox