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
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.
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.
To work around this issue, modify the 16-pixel-by-16-pixel version of the icon. To do this, follow these steps:
- Start Visual Studio 2005.
- In Solution Explorer, right-click the icon file, and then click Open.
- 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. - 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. - On the File menu, click Save FileName.
- On the File menu, click Close.
This behavior is by design.
Steps to reproduce the behavior
- Create a new Windows Application project. To do this, follow these steps:
- Start Visual Studio 2005.
- On the File menu, point to New, and then click Project.
- In the Project types list, click Windows.
- In the Templates list, click Windows Application, and then click OK.
- Add an icon file to the project. To do this, follow these steps:
- In Solution Explorer, right-click the name of the project, point to Add, and then click New Item.
- Click Icon File, and then click OK.
- Change the icon.
- On the File menu, click Save Icon1.ico.
- Add the new icon to the form. To do this, follow these steps:
- In Solution Explorer, double-click Form1.cs.
- 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.
- 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:
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
| 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
(Optional) Name
(Optional)
Public URL Or Email
Comments
No
HTML -- Text Only Please