• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 590
  • Last Modified:

Icon Not Appearing In Winform header - Visual Studio 2008

I have tried to place an Icon in a Winform header, I have done this before by selecting the graphic - with and .ico extension, as the Icon for a Form.. For some reason it is not displaying for this project...

Any ideas?  Thanks!
  • 2
  • 2
2 Solutions
AndyAinscowFreelance programmer / ConsultantCommented:
No icon for the display colourdepth on the screen ?
jamesdean666Author Commented:
I'm sorry AndyAinscow.. I'm not clear on what you're saying.. :)
AndyAinscowFreelance programmer / ConsultantCommented:
Your monitor is set for a colour depth eg. 32 bit - does the icon actually contin a picture at that setting ?
Vikram Singh SainiSoftware Engineer cum AD DeveloperCommented:

The reason your icon is not visible in Window Forms header could be that your Icon(.ico) file is corrupted. Or your program is not able to access resources from Resource as:

this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));

Please check code for setting image as icon or icon as icon.


private void Form1_Load(object sender, EventArgs e)
            //1// Set icon from icon file as
            Icon ico = new Icon(@"D:\Zodes\g.ico");
            this.Icon = ico;

            //2// Set image as icon
            Bitmap bmp=new Bitmap(@"D:\Zodes\s.jpg");
            this.Icon = Icon.FromHandle(bmp.GetHicon());


Open in new window

jamesdean666Author Commented:
The issue was actually the fact that I was hiding the Windows buttons, i.e. close, max, min.

Once I made them visible, my icon appears.

Thanks all.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now