Microsoft KB Archive/324969

= HOW TO: Add an Application Icon to a Visual J# .NET Application =

Article ID: 324969

Article Last Modified on 8/7/2003

-

APPLIES TO


 * Microsoft Visual J# .NET 2003 Standard Edition
 * Microsoft Visual J# .NET 2003 Standard Edition

-



This article was previously published under Q324969



IN THIS TASK
SUMMARY
 * Add an Application Icon to a Visual J# .NET Application



SUMMARY
This step-by-step article describes how to add an application icon to a Visual J# .NET application.

The Microsoft Visual Basic .NET and Microsoft Visual C# .NET /win32icon compiler option inserts an icon (.ico) file in the output file, which gives the output file the appearance that you want in Windows Explorer. The Visual J# .NET compiler does not support the /win32icon option. To work around this, you can create a resource compiler script file for the icon, and then create a resource (.res) file by using the Rc.exe utility. You can add the resource file to a Visual J# .NET application by using the compiler /win32res option.

back to the top

Add an Application Icon to a Visual J# .NET Application
  In Notepad, use the following code to create a resource compiler script file that references the icon: 1  ICON    &quot;icon.ico&quot;  Save the file in Notepad as Icon.rc. Run the following at a command prompt to create a resource (.res) file named Icon.res:

rc icon.rc

 Compile the Visual J# .NET application and reference the icon resource file (Icon.res) by using the /win32res option. You can do this from the command line or in the Microsoft Visual Studio development environment. To do this from the command line, run the following command:

vjc /win32res:icon.res app.jsl

To do this from the Microsoft Visual Studio development environment:

 Open the Property Pages dialog box for the project. Click the Configuration Properties folder. Click the Advanced tab.</li> Add the following to the Additional Options property:

/win32res:icon.res

</li></ol>

The resulting .exe file will have the appropriate icon next to it when you view it in Windows Explorer.</li></ol>

back to the top

Additional query words: vjsharp jsharp icon

Keywords: kbhowtomaster kbicon kbwindowsforms KB324969

-

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

© Microsoft Corporation. All rights reserved.