|
-
May 21st, 2002, 10:27 PM
#1
Lisview subitems - how do I get images for these??
In VB6 I could easily insert items and sub items into a listview. With the sub items I could also specify an image and all the other attributes.
VB .NET seems to have 100's of options for all things great and small but I'll be a monkey's uncle if I could find how to set an image for a sub item.
Although after I insert a sub item I get a sub item back which can be used it does not have the required methods or interface for images. Very frustrating as this was easy in VB6 and we are meant to be moving forward in .NET.
A bit of my code is :-
itm = lvSearch.Items.Add("Item text", ImageNo)
sitm = itm.SubItems.Add("string1")
sitm = itm.SubItems.Add("string2")
Any tips welcome!
-
Mar 7th, 2003, 02:30 AM
#2
New Member
Kiweed. Could you please explain to me how you got the image into a subitem in VB6?
I need this for a listview where the second column (subitem(1))needs to show a performance icon (e.g. red dot, green dot, orange dot) and the third column (subitem(2)) a trend indicator (arrow up, arrow down, arrow right).
-
Mar 7th, 2003, 04:09 AM
#3
Junior Member
First you must delegate an Image List to the ListView control.
VB Code:
ListView1.SmallImageList = ImageList1
ListView1.Items.Add("My Text", 0)
The arrow shot by the archer may, or may not, kill a single person. However, stratagems devised by a wise man, can kill even babes in the womb.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|