The following code checks the value of a menu item to see if the status of items should be displayed. If status display is active, the code checks the value of the Tag property of each list item and sets the Image property accordingly. If status display is inactive, the Image for the item is set to an image named "Unchecked."
Private Sub ImageCombo1_DropDown()
If mnuShowStatus.Checked = True Then
For Each CboItem in ImageCombo1.ComboItems
Select Case CboItem.Tag
Case "Locked"
CboItem.Image = "Padlock"
Case "Deleted"
CboItem.Image = "X-mark"
Case "Checked"
CboItem.Image = "Checkmark"
Case Else
CboItem.Image = "Unchecked"
End Select
Next CboItem
Else
For Each CboItem in ImageCombo1.ComboItems
CboItem.Image = "Unchecked"
Next CboItem
End If
End Sub
In the above code, "Unchecked, "Padlock", "X-mark" and "Checkmark" are key values that indicate particular images in the ImageList control associated with the ImageCombo.