TabControl.ImageList Property


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Gets or sets the images to display on the control's tabs.

Namespace:   System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

public ImageList ImageList { get; set; }

Property Value

Type: System.Windows.Forms.ImageList

An ImageList that specifies the images to display on the tabs.

To display an image on a tab, set the ImageIndex property of that TabPage. The ImageIndex acts as the index into the ImageList.

The following code example creates a TabControl with one TabPage. This example uses the ImageList property to display images, from the collection defined by the ImageList named myImages, on the tabs of tabControl1.

Use the System.Drawing, System.ComponentModel, System.Windows.Forms, and System.Resources namespaces for this example.

using System.Drawing;
using System.ComponentModel;
using System.Windows.Forms;
using System.Resources;

public class Form1 : Form
    public Form1()
        IContainer components = new Container();
        ResourceManager resources = new ResourceManager(typeof(Form1));
        TabControl tabControl1 = new TabControl();
        TabPage tabPage1 = new TabPage();

        // Declares and instantiates the ImageList object.
        ImageList myImages = new ImageList(components);

        // Sets the images in myImages to display on the tabs of tabControl1. 
        tabControl1.ImageList = myImages;

        tabPage1.ImageIndex = 0;
        tabPage1.Text = "tabPage1";

        // Gets the handle that provides the data of myImages.
        myImages.ImageStream = ((ImageListStreamer)(resources.GetObject("myImages.ImageStream")));

        // Sets properties of myImages. 
        myImages.ColorDepth = ColorDepth.Depth8Bit;
        myImages.ImageSize = new Size(16, 16);
        myImages.TransparentColor = Color.Transparent;


    static void Main() 
        Application.Run(new Form1());

.NET Framework
Available since 1.1
Return to top