?
Solved

Icon Not Appearing In Winform header - Visual Studio 2008

Posted on 2010-08-13
5
Medium Priority
?
569 Views
Last Modified: 2013-11-26
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!
0
Comment
Question by:jamesdean666
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 33432051
No icon for the display colourdepth on the screen ?
0
 

Author Comment

by:jamesdean666
ID: 33432396
I'm sorry AndyAinscow.. I'm not clear on what you're saying.. :)
0
 
LVL 44

Accepted Solution

by:
AndyAinscow earned 1000 total points
ID: 33432485
Your monitor is set for a colour depth eg. 32 bit - does the icon actually contin a picture at that setting ?
0
 
LVL 16

Assisted Solution

by:Vikram Singh Saini
Vikram Singh Saini earned 1000 total points
ID: 33434982
Hi,

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.

Regards,
V.S.Saini

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

0
 

Author Closing Comment

by:jamesdean666
ID: 34962444
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.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question