Setting Form's Icon at runtime from a ImageList

  • Thread starter Thread starter VJ
  • Start date Start date
V

VJ

I am trying to set my Form's Icon property at run time based on certain
parameters. I have a imglist in the form for other purposes I would like to
use the same image list to keep the Forms icon and set the icon. How do I
get this done..

VJ
 
Found this one.. here is how you do it...

Dim bmp As Bitmap
bmp = ImageList1.Images(1)
Me.Icon = Icon.FromHandle(bmp.GetHicon)
bmp.Dispose()
 
Hi,

Dim bm As Bitmap = ImageList1.Images(0)

Me.Icon = Icon.FromHandle(bm.GetHicon)



Ken
 
* "VJ said:
I am trying to set my Form's Icon property at run time based on certain
parameters. I have a imglist in the form for other purposes I would like to
use the same image list to keep the Forms icon and set the icon. How do I
get this done..

Don't use an imagelist for this purpose. Instead, use an embedded
icon:

<http://groups.google.de/[email protected]>
 
Back
Top