Welcome to WindowsClient.net | Sign in | Join

Here are some frequently asked questions about Windows Forms and their answers.

Windows Forms FAQs

How do I programmatically set a Form's icon from a bitmap?

You could do so as shown in the code below :

Form form1 = new Form(); 
Bitmap bmp = imageList1.Images[index] as Bitmap; 
form1.Icon = Icon.FromHandle(bmp.GetHicon()); 

Please refer to the sample attached here that illustrates this.

Contributed from George Shepherd's Windows Forms FAQ



Page view counter