Version

Display Images in WinListView

This topic shows you how images can be displayed next to the Text of an item in WinListView™.

This topic assumes that you have an ImageList control dropped onto the form with few sample images in it. Assign the ImageList control to WinListView, through the ImageList property. The ImageList property is exposed for each of the view-specific setting objects. In the sample code below, the WinListView control’s View property is set to List and therefore the ImageList property is applied through the ViewSettingsList object.

In Visual Basic:

' Assign the ImageList control to WinListView
Me.ultraListView1.ViewSettingsList.ImageList = Me.imageList1
' Add image to WinListView by setting the index of the image in ImageList control
Me.ultraListView1.Groups[0].Items[0].Appearance.Image = 1
Me.ultraListView1.Groups[0].Items[1].Appearance.Image = 2
...
...

In C#:

// Assign the ImageList control to WinListView
this.ultraListView1.ViewSettingsList.ImageList = this.imageList1;
// Add image to WinListView by setting the index of the image in ImageList control
this.ultraListView1.Groups[0].Items[0].Appearance.Image = 1;
this.ultraListView1.Groups[0].Items[1].Appearance.Image = 2;
...
...
WinListView Displaying Images in WinListView.png