Add a ListView control to the form.
Add 2 ImageList controls to the form.
Add some bitmaps to both the imagelist.
Set the name of image list to the Normal and small icon Image List from the Image lists tab in property pallet of the Listview control.
Add a combobox .
Add this sample code to the form
=============================
Expand|Select|Wrap|Line Numbers
- Private Sub Combo1_Click()
- LV1.View = Combo1.ListIndex
- End Sub
- Private Sub Form_Load()
- Dim C As ColumnHeader
- Dim i As Integer
- For i = 1 To 4
- Set C = LV1.ColumnHeaders.Add()
- C.Text = "Field" & i
- C.Width = LV1.Width / 4
- Next i
- Dim li1 As ListItem
- Set li1 = LV1.ListItems.Add()
- li1.Text = "Item 1"
- li1.Icon = 4
- li1.SmallIcon = 1
- LV1.ListItems(1).ListSubItems.Add , , "Field2"
- LV1.ListItems(1).ListSubItems.Add , , "Field3"
- LV1.ListItems(1).ListSubItems.Add , , "Field4"
- Dim li2 As ListItem
- Set li2 = LV1.ListItems.Add()
- li2.Text = "Item 2"
- li2.Icon = 4
- li2.SmallIcon = 1
- LV1.ListItems(2).ListSubItems.Add , , "Field2"
- LV1.ListItems(2).ListSubItems.Add , , "Field3"
- LV1.ListItems(2).ListSubItems.Add , , "Field4"
- Dim li3 As ListItem
- Set li3 = LV1.ListItems.Add()
- li3.Text = "Item 3"
- li3.Icon = 4
- li3.SmallIcon = 1
- LV1.ListItems(3).ListSubItems.Add , , "Field2"
- LV1.ListItems(3).ListSubItems.Add , , "Field3"
- LV1.ListItems(3).ListSubItems.Add , , "Field4"
- With Combo1
- .AddItem "Icon View"
- .AddItem "Small Icon View"
- .AddItem "List View"
- .AddItem "Report View"
- End With
- End Sub