Add image to statusbar panel from imagelist- is it possible?

T

Thief_

In VB6, I can use:

StatusBar1.Panels(1).Picture = ImageList1.ListImages(1).Picture

I can't figger out how to do it in VB.Net 2003. I tried converting the
project to .Net and got:

StatusBar1.Panels(1).let_Picture(ImageList1.ListImages(1).Picture)

But that's using the VB6 statusbar & imagelist controls. It doesn't work in
VB.Net statusbar & imagelist controls. Can it be done?
 
K

Ken Tucker [MVP]

Hi,

Dim ico As Icon
Dim ptrIcon As IntPtr

ptrIcon = DirectCast(ImageList1.Images.Item(0), Bitmap).GetHicon
ico = Icon.FromHandle(ptrIcon)
StatusBarPanel1.Icon = ico

StatusBar1.ShowPanels = True

Ken
-------------------
In VB6, I can use:

StatusBar1.Panels(1).Picture = ImageList1.ListImages(1).Picture

I can't figger out how to do it in VB.Net 2003. I tried converting the
project to .Net and got:

StatusBar1.Panels(1).let_Picture(ImageList1.ListImages(1).Picture)

But that's using the VB6 statusbar & imagelist controls. It doesn't work in
VB.Net statusbar & imagelist controls. Can it be done?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top