none
Can't add Icon to Shortcut

    Question

  • I'm trying to add an icon to my vb.net program in Visual Studio 2010.   I've created a icon.ico file, and put it into an Icon folder in the File System of my Setup project.  I've created a shortcut in the User's Desktop folder in the same File System.   When I click on the Shortcut and see Properties, I click the Icon property and try to browse for my icon.  I find it, select it;  it shows up in the File name: textbox....   BUT, it does not let me click OK.   The OK button is disabled.

    Any thoughts on why it's not letting me add the icon.ico file to my Icon property?

    Thank you,

    Gina


    Gina

    Thursday, August 15, 2013 4:49 PM

Answers

  • A couple things:  

    First: Is your icon file a real icon file, or is it a bmp or png that has just been renamed?  There are sites online that can convert regular pictures to icon files.  

    Second: You can add the icon file directly to your exe so all shortcuts (and the exe itself) will display your icon automatically.  This is done by going into your project's properties (should be the last option on the "Project" menu), and on the Application tab is an "Icon" drop down.  Click that and choose "Browse..." then select your icon.  Now, when you compile (build) your program, it will have that icon.

    Hope that helps!

    Ray


    • Marked as answer by Gina Becker Thursday, August 15, 2013 6:37 PM
    Thursday, August 15, 2013 6:14 PM

All replies

  • A couple things:  

    First: Is your icon file a real icon file, or is it a bmp or png that has just been renamed?  There are sites online that can convert regular pictures to icon files.  

    Second: You can add the icon file directly to your exe so all shortcuts (and the exe itself) will display your icon automatically.  This is done by going into your project's properties (should be the last option on the "Project" menu), and on the Application tab is an "Icon" drop down.  Click that and choose "Browse..." then select your icon.  Now, when you compile (build) your program, it will have that icon.

    Hope that helps!

    Ray


    • Marked as answer by Gina Becker Thursday, August 15, 2013 6:37 PM
    Thursday, August 15, 2013 6:14 PM
  • Ray, This helps!   I found the Icon dropdown and tried to add the file, but it said this was not a valid icon file.  You must be right;  I'm doing something wrong in converting it.  I had found a website that directed me through using  Microsoft Paint to convert my square image to an .ico file, but I guess it didn't work right.

    I'll look for other websites.

    Gina


    Gina

    Thursday, August 15, 2013 6:29 PM
  • It worked!  I used freefileconvert.com

    Thank you!

    Gina


    Gina

    Thursday, August 15, 2013 6:38 PM
  • I had found a website that directed me through using  Microsoft Paint to convert my square image to an .ico file, but I guess it didn't work right.

    I'll look for other websites.

    There are a couple of suggestions for .ico editors at stackoverflow.com/questions/523255/what-is-a-great-free-icon-editor-for-windows.

    HTH,

    Andrew

    Thursday, August 15, 2013 6:43 PM
  • Hi Gina, 

    Here's an online one I've used several times:

    http://iconverticons.com/online/

    Just browse to the original image and it will create an ICO file to download.  I've never had problems with it.

    Good luck!

    Ray


    Thursday, August 15, 2013 6:55 PM
  • Ray, One more question:   If I set my icon on the Properties/ Application tab as a file for the whole project, do I need to delete it from other places, like my shortcut, for it to work globally?

    I notice in the Uninstall programs windows, the icon does not show up.  It has a generic icon that looks like a page with lines.  And I have set the icon on the Properties/Application tab to my icon file.


    Gina

    Thursday, August 15, 2013 7:03 PM
  • You will likely have to regenerate anything that should use the icon.  So deleting the old shortcut and creating a new one should show the icon.  You will probably have to recreate any installer that you used also.  Depending on the installer, you may have to explicitly set the icon there as well.  I've only used Inno Setup for an installer and that was a long time ago.  I would assume the one Visual Studio creates would use the icon if you re-ran the installer generator (I've never used it so I can't help much there).  You would then need to uninstall and reinstall your app to have the icon show up in Add/Remove programs.

    Ray

    Thursday, August 15, 2013 7:08 PM