• Welcome to Valhalla Legends Archive.
 

[VB6] Changing ListView's SmallIcons at Run-Time

Started by Chriso, November 11, 2007, 06:22 PM

Previous topic - Next topic

Chriso

I am trying to change a ListView's SmallIcon set at run-time when the ListView is populated.  The existing items in the ListView do not update using the new ImageList, however new items do.  Anyone know a way around this?

I am currently doing this with no success:

Set lvUsers.SmallIcons = imlClassic
lvUsers.Refresh

Barabajagal

Perhaps try doing lvUsers.ListItems(I).SmallIcon = lvUsers.ListItems(I).SmallIcon or something to that effect?

Chriso


brew

Are you trying to change the imagelist?
I suggest doing it by:
SendMessage(lvUsers.hWnd, LVM_SETIMAGELIST, LVSIL_SMALL, (LPARAM)imlClassic.hWnd);
<3 Zorm
Quote[01:08:05 AM] <@Zorm> haha, me get pussy? don't kid yourself quik
Scio te esse, sed quid sumne? :P

Chriso


Chriso

#5
No good  :(

Edit: Oops forgot to use ByVal in the listviews hWnd, it works now :)
    SendMessage lv.hwnd, LVM_SETIMAGELIST, LVSIL_SMALL, ByVal imlClassic.hImageList

brew

Sorry for my VB-C fusion code, but at least it got the idea across. I'm glad it's working.
<3 Zorm
Quote[01:08:05 AM] <@Zorm> haha, me get pussy? don't kid yourself quik
Scio te esse, sed quid sumne? :P