system drawing image cannot be converted...

  • Thread starter Thread starter alex
  • Start date Start date
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
 
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
 
* "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.
 
Back
Top