Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Set Icon in a Windows Application using Visual Studio

I want to add an icon to my application. I have added an icon resource. and its working file for the first icon. That means after I have compiled, the 16x16 icon of the exe file is same as the icon file used. but when the explorer window is zoomed to large icon size, then the icon of the exe file vanishes and another blank default icon is displayed.

How to set icon for large as well as small size display?

like image 776
S. Swaroop Avatar asked Feb 14 '12 20:02

S. Swaroop


People also ask

How do I add icons to Windows Form Application?

Go to Project Menu -> Add New Item -> Icon File Show activity on this post.

How do I add an icon to a program?

To do this, search for an app in the Start menu, then right-click its name and choose Open file location. In the resulting folder, right-click the program name and choose Send to > Desktop (create shortcut). Now you can modify the new shortcut on your desktop. Right-click it and choose Properties to open a new window.

How do I add an icon to a button in Visual Studio?

create an image. set the source of the image to the right file of your resources (e.g. a . png file that you included to your project) drag the image over the button. A text shows that asks you to press ALT to replace the text of the button with the image.


1 Answers

From your comments, it sounds like you have multiple icon files set for your project. That's not going to work the way you want, or at least it's the really hard way of doing it.

The simple way is to let the operating system handle it for you. Create a single icon file that contains multiple icon sizes. 16x16, 32x32, 48x48, and 256x256 are the minimum sizes needed for current versions of Windows, but you can certainly add more (like 24x24 or 128x128) to improve pixel fidelity at those sizes if desired.

You can use Visual Studio to create the icons. Opening an .ico file should automatically open its icon resource editor. But I personally find it difficult or cumbersome to use. I highly recommend using a third-party program like IcoFX to create your icons and push pixels around.

like image 102
Cody Gray Avatar answered Oct 06 '22 04:10

Cody Gray