Microsoft KB Archive/914349

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

Article ID: 914349

Article Last Modified on 4/14/2006

-

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

-





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.
 * 1) 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.
 * 1) On the File menu, click Save  .
 * 2) On the File menu, click Close.



STATUS
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.</li></ol> </li> Add an icon file to the project. To do this, follow these steps: <ol style="list-style-type: lower-alpha;"> In Solution Explorer, right-click the name of the project, point to Add, and then click New Item.</li> Click Icon File, and then click OK.</li> Change the icon.</li> On the File menu, click Save .</li></ol> </li> Add the new icon to the form. To do this, follow these steps: <ol style="list-style-type: lower-alpha;"> In Solution Explorer, double-click Form1.cs.</li> Under Properties, set the Icon property to  .

Note The icon image under Properties appears correctly. However, the icon image on the form does not appear correctly.</li></ol> </li> On the Debug menu, click Start Debugging.

Note The icon on the form does not appear correctly.</li></ol>

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/useritems/HowToIcon.asp

Keywords: kbtshoot kbnofix kbprb KB914349

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.