system drawing image cannot be converted...

A

alex

Hi,
I am having an image list with a set of icons i want to use in my
application.

when using
Me.control.Icon = iconList.Images(1)
i get the error message

Value of type 'System.Drawing.Image' cannot be converted to
'System.Drawing.Icon'.

How can I use the icon list ?

Thanks for any help
Alex
 
F

Fergus Cooney

Hi Alex,

This was given as a solution to this question a while back but I don't
know whether it works.

Dim bmpIcon As Bitmap = CType (iconList.Images(0), Bitmap)
Me.control.Icon = Icon.FromHandle (bmpIcon.GetHicon)

Regards,
Fergus
 
H

Herfried K. Wagner [MVP]

* "Fergus Cooney said:
This was given as a solution to this question a while back but I don't
know whether it works.

Dim bmpIcon As Bitmap = CType (iconList.Images(0), Bitmap)
Me.control.Icon = Icon.FromHandle (bmpIcon.GetHicon)

It works but the quality of the icon may be bad.
 

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