Question Setting Listview item text and subitems using callback

beisikas

New member
Joined
Oct 2, 2009
Messages
2
Programming Experience
3-5
Hi all.

I have successfully subclassed my Listview using NativeWindow, I am able to
recieve messages from ListView.

The question is so:
I add a ListViewItem to ListView.Items collection without setting the Items
text and subitems (2 at all):
'code:
Listview1.Items.Add(New ListviewItem)
'end of code

Then, I want to set the text and subitems only when this is requiered. T.i.,
I want to use Listview notification messages, which are sent when Listview
needs to display Item's text or subitem's text.

Why I don't use VirtualListview? Because it's event RetrieveVirtualItems is
called many times, e.g., if the item has 2 subitems, the function is called
3 times for the same ItemIndex :( And if I could use the notification
messages, I would be able to set items text together with 2 subitems at the
same time (when the message for current item is sent, saying that Listview
needs to display item' text), and Listview would not send next two messages,
notificating that it needs the first and the second subitem, because it
already has all the neccessary info (text and subitems).
I found some examples for VB, but there almost useless for vb.net.

Maybe someone could suggest a good site or peace of code?

Thanks in advance.
 
Back
Top