Skip to main content Skip to footer

How to Display Images Alongside Text Items in ComboBox

When building desktop applications, you may need to display visual icons or images next to text options inside a dropdown selection list (such as showing shape icons, status indicators, or category symbols). Standard combo boxes often require complex owner-draw logic to paint images next to text strings.

Solution
You can display images alongside text items in ComboBox without custom painting by using the control's built-in ItemsImageList property.

  1. Create a standard ImageList instance containing the icons you wish to display.

  2. Assign the ImageList instance to the ItemsImageList property of the ComboBox.

  3. Add key-indexed images to the ImageList that match the string keys or item identifiers added to ComboBox.Items. The control will automatically match and paint the corresponding image next to the item text in the dropdown overlay.

    private void Form1_Load(object sender, EventArgs e)
    {
        // Initialize ImageList and assign to ComboBox
        ImageList itemImages = new ImageList();
        comboBox1.ItemsImageList = itemImages;
    
        // Add key-indexed images and matching text items
        AddComboBoxItem("Circle", "shape_circle.png", itemImages);
        AddComboBoxItem("Square", "shape_square.png", itemImages);
        AddComboBoxItem("Triangle", "shape_triangle.png", itemImages);
    
        // Select default option
        comboBox1.SelectedIndex = 0;
    }
    
    private void AddComboBoxItem(string itemText, string imagePath, ImageList imageList)
    {
        // Add image using text key
        imageList.Images.Add(itemText, Image.FromFile(imagePath));
        
        // Add matching string item to the ComboBox
        comboBox1.Items.Add(itemText);
    }