Click to See Complete Forum and Search --> : How can I draw Form.Icon to control Label.Image.


Olap
August 21st, 2003, 03:57 AM
Hi,

I have a problem, I dont know how to set "Icon", which is used for the Form to the "Label.Image" on the Form, at the run time?
How can I convert Icon to Image?
I would like have the same pistures in Form.Icon and Label.Image.
I set Form.Icon at design time, in run time a want to get Icon from Form convert to Image a set it to Label.Image.

Thanks,
Olap from Slovakia.

dynamic_sysop
August 21st, 2003, 09:12 AM
not sure if this is what you are after, but here you go...

Bitmap bmp= Bitmap.FromHicon(this.Icon.Handle);
label1.Image = bmp;

Eco
January 20th, 2004, 04:03 AM
Is this also possible the other way round? E.g. i want to use an image from an image list as an icon for a form.

Thanks,
Eco

IsaacTheIceMan
January 22nd, 2004, 10:03 AM
Bitmap bmp = Bitmap(label1.Image);
//lalala
Icon icon = Icon.FromHandle(bmp.GetHIcon());
//more lalala