Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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??

  • *Experts*
Posted (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 by DiverDan

Member, in good standing, of the elite fraternity of mentally challenged programmers.

 

Dolphins Software

Posted

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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...