Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

OK, im new to VB.NET but have been a visual fox developer for seven years or so.

 

what I'm trying to do is create a listview in detail view with some graphical icons down the side, easy you may think but Ive been going at this for around 4 days now (on and off) and I cant get it to do anything.

 

does anyone know how to populate an imagelist programmaticall so I can attach images (at runtime) into the listview by use of a key (an index will do at the moment)

 

dim imagex as image

 

dim imagelistx as new ImageList

 

 

imageListx.Images.Item(1).FromFile("g:\hd\datadev\graphics\add.bmp")

 

 

me.ListView1.SmallImageList = imageListx

 

me.ListView1.Items.Add("test 1")

me.ListView1.Items(1).ImageIndex = 1

me.ListView1.Items.Add("test 2")

me.ListView1.Items(2).ImageIndex = 1

me.ListView1.Items.Add("test 3")

me.ListView1.Items(3).ImageIndex = 1

me.ListView1.Items.Add("test 4")

me.ListView1.Items(4).ImageIndex = 1

 

it dosent work.

 

if anyone could help I would be forever greatful. and its my 30th birthday today so I'd really like to get this going.

 

Any resources would be helpfull.

 

Thanks in advance.

 

Steve.

Posted

Hello fellow Fox coder...

 

I think I may have some code that would be helpful.

 

imageList.Images.Add(Bitmap.FromFile("c:\weblookup\exclem.ico"))

 

imageList.Images.Add(Bitmap.FromFile("c:\weblookup\misc02.ico"))

 

lbHistory.SmallImageList = imageList

 

Me.lbHistory.Items.Add(strWork, 0).ForeColor = System.Drawing.Color.Fuchsia

 

These four lines of code should come in handy. Let me know if you need further help. I'm doing this in the current VB.NET app I'm working on; so I ought to be able to help...

 

Good luck

Ben

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