Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Set and deselect SmallIcons for ListView

Status
Not open for further replies.

graabein

Programmer
Oct 9, 2002
186
NO
Hi, I'm working on a project where sometimes I want SmallIcons (from an ImageList) displayed for a ListView, and sometimes I don't want icons (or blank space in front of each ListItem).

How can I switch back and forth during runtime? I don't want to introduce another ListView instance.

[elephant2]
graabein
 
I've tried this code before populating the ListView when I don't want icons, but I still get a leading white space in each ListItem.

Code:
Set lv.SmallIcons = Nothing
Set lv.Icons = Nothing
Set lv.ColumnHeaderIcons = Nothing

Setting back icons works fine, no problem.

Code:
Set lv.SmallIcons = frmMain.imgIcons
Set lv.Icons = frmMain.imgIcons
Set lv.ColumnHeaderIcons = frmMain.imgIcons



[elephant2]
graabein
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top