MadMaxMSCN Posted September 2, 2004 Posted September 2, 2004 Hi, I'm converting from vb6 to vb.net I have to set a ImageList to a ListView. In VB6 it's done in this line: ListView_SetImageList = SendMessage(hWnd, LVM_SETIMAGELIST, ByVal iImageList, ByVal himl) himl is set here: himl = ilImageList1.hImageList and hWnd is: hWnd = lvListView.hWnd it works pretty. Now my problem: in vb.net no images are shown. is there a problem with himl or hWnd in vb.net? (no one of those is 0, but is ist the right value??) can anybody help me?? Quote
*Experts* DiverDan Posted September 2, 2004 *Experts* Posted September 2, 2004 (edited) I don't know how the images are displayed in your situation, but you can set the listview's image list in the designer, either as SmallImageList for images on the left of the listview text or as LargeImageList for images that are on top of the listview text simalir to Windows Explorer in View Large Icons. You can also set these properities in code or dynampically using the same parameters. Also, for images on the left of the listview text set the listview View properity to Details and for images above the listvies text, set listview View properity to either LargeIcon or SmallIcon depending on your preference. Edited September 2, 2004 by DiverDan Quote Member, in good standing, of the elite fraternity of mentally challenged programmers. Dolphins Software
MadMaxMSCN Posted September 3, 2004 Author Posted September 3, 2004 I know that. My ListView is a special one. It contains some kind of tree. The ImageList set in .smallicons works fine, but there is a second one. These icons show if the tree is collapsed or not. I took this tree-ListView from here It works pretty in vb6 but not in vb.net. The first ImageList set in .smallicons works in .net but the second one set with SendMessage doesn't work in .net I don't know how this works, but it does in vb6. :confused: Setting the second one in .smallimages doesn't work, because it overwrites the first one. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.