Microsoft Knowledge Base Email Alertz

KBAlertz.com: Changes in a custom icon for a Windows form may not appear in the upper-left corner of the form in Visual Studio 2005

Receive Microsoft Knowledge Base articles by E-Mail?

Every night we scan the Microsoft Knowledge Base. If technologies you're interested in are updated, we'll send you an e-mail. You only get one e-mail a day, and only when new articles are added.

Click here to create a
FREE account
Already have an account?
[Click here to Login]

Search KbAlertz

Advanced Search

Webmasters
Put kbAlertz on your website.
[ Click Here for more! ]





ASP.NET 3.5 Web Hosting with Windows 2008 and SQL 2008: Click Here!
Discount ASP.NET Hosting
ASP.NET 2.0 and 3.5
Windows2008 and SQL2008
US and UK Hosting
The ad says 3 - but KBAlertz referrals get
** SIX MONTHS FREE **


Bug Tracking Software
For bug tracking software or defect tracking software or issue tracking software, visit Axosoft.


Community Site



We Send hundreds of thousands of emails using ASP.NET Email



Expert Web Design & Graphic Design
Design44.com

ASP.NET 3.5 Web Hosting with Windows 2008 and SQL 2008: Click Here!
Discount ASP.NET Hosting
ASP.NET 2.0 and 3.5
Windows2008 and SQL2008
US and UK Hosting
The ad says 3 - but KBAlertz referrals get
** SIX MONTHS FREE **




Mentioned In








Microsoft Knowledge Base Article

This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks




Article ID: 914349 - Last Review: April 14, 2006 - Revision: 1.5

Changes in a custom icon for a Windows form may not appear in the upper-left corner of the form in Visual Studio 2005

On This Page

SYMPTOMS

After you change the custom icon for a Microsoft Windows form in Microsoft Visual Studio 2005, your changes may not appear in the upper-left corner of the form. This behavior occurs when the Icon property of the form is set to a custom icon file.

Note This problem does not occur in Microsoft Visual Basic .NET 2003 or in Microsoft Visual Basic .NET 2002.

CAUSE

This issue occurs because the 16-pixel-by-16-pixel version of the icon that is used for the form has not been changed. By default, Visual Studio 2005 creates both a 32-pixel-by-32-pixel version and a 16-pixel-by-16-pixel version of new icons. By default, when you change an icon in Visual Studio 2005, the 32-pixel-by-32-pixel version of the icon is updated. Windows forms use 16-pixel-by-16-pixel icons.

Note This issue occurs in Microsoft Visual C++, in Microsoft Visual C#, and in Microsoft Visual Basic 2005. Both Visual Basic 2003 and Visual Basic 2002 use 32-pixel-by-32-pixel icons and are not affected by this problem.

WORKAROUND

To work around this issue, modify the 16-pixel-by-16-pixel version of the icon. To do this, follow these steps:
  1. Start Visual Studio 2005.
  2. In Solution Explorer, right-click the icon file, and then click Open.
  3. On the Image menu, point to Current Icon Image Types, and then click 16x16 256 Colors.

    Note If the 16x16 256 Colors option is unavailable, click New Image Type on the Image menu, and then double-click 16x16 256 Colors.
  4. Modify the icon image by using the tools that are provided in Visual Studio.

    Note This icon image is the icon image that the Windows form will use.
  5. On the File menu, click Save FileName.
  6. On the File menu, click Close.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to reproduce the behavior

  1. Create a new Windows Application project. To do this, follow these steps:
    1. Start Visual Studio 2005.
    2. On the File menu, point to New, and then click Project.
    3. In the Project types list, click Windows.
    4. In the Templates list, click Windows Application, and then click OK.
  2. Add an icon file to the project. To do this, follow these steps:
    1. In Solution Explorer, right-click the name of the project, point to Add, and then click New Item.
    2. Click Icon File, and then click OK.
    3. Change the icon.
    4. On the File menu, click Save Icon1.ico.
  3. Add the new icon to the form. To do this, follow these steps:
    1. In Solution Explorer, double-click Form1.cs.
    2. Under Properties, set the Icon property to Icon1.ico.

      Note The icon image under Properties appears correctly. However, the icon image on the form does not appear correctly.
  4. On the Debug menu, click Start Debugging.

    Note The icon on the form does not appear correctly.
For more information about how to create icon files for Windows applications by using Visual Studio and Microsoft Paint, visit the following Web site:
http://www.codeproject.com/KB/graphics/HowToIcon.aspx (http://www.codeproject.com/KB/graphics/HowToIcon.aspx)

APPLIES TO
  • Microsoft Visual Studio 2005 Professional Edition
  • Microsoft Visual Studio .NET 2003 Professional Edition
  • Microsoft Visual Studio .NET 2002 Professional Edition
  • Microsoft Visual C++ 6.1
  • Microsoft Visual C# .NET 2003 Standard Edition
  • Microsoft Visual C# .NET 2002 Standard Edition
  • Microsoft Visual Basic .NET 2003 Standard Edition
  • Microsoft Visual Basic .NET 2002 Standard Edition
Keywords: 
kbnofix kbtshoot kbprb KB914349
       

Community Feedback System

Very often, it takes hours to solve a problem. Very often, you've looked high and low, and have tried a lot of solutions. When you finally found it, chances are, it was because someone else helped you. Here's your chance to give back. Use our community feedback tool to let others know what worked for you and what didn't.

Please also understand that the community feedback system is not warranted to be correct, it's simply a system that we've built to let people try and help each other. If something in a feedback response doesn't make sense to you, or you're not comfortable making changes that the feedback talks about (like registry edits), please consult a professional.

Thank you for using kbAlertz.com Feedback System.

-- Scott Cate

sumitha Report As Irrelevant  
Written: 5/14/2008 2:32 AM
its very help ful

(Optional) Name

(Optional) Public URL Or Email

Comments
No HTML -- Text Only Please