|
-
Dec 28th, 2005, 02:41 PM
#1
Thread Starter
Addicted Member
How to add more icons in exe?
How to achieve this: when right click on my exe shorcut->properties->change icon to be able to choose more than one icon?
I tried to put two icon files in exe and set build action='Embedded Resource' and build action='Content', but when compile exe, create shortcut and try to change icon always I get only one icon (icon which is set in project->properties->application icon).
regard j
-
Dec 28th, 2005, 03:19 PM
#2
Re: How to add more icons in exe?
I could be wrong as I've never delt with this, but I don't think you'll be able to use embeded an embedded resource. You could add icon items to your project and deploy them with your application, so the user could browse to them.
-
Dec 28th, 2005, 03:34 PM
#3
Re: How to add more icons in exe?
When you add a icon as an embedded resource it gets compiled into the exe file. Seems you should be able to browse them using an icon explorer program but it doesnt work.
In VB6 I think it worked that way but I havent come across this issue before. Hmm...
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Dec 28th, 2005, 03:59 PM
#4
Re: How to add more icons in exe?
Here is how I was able to load the icons after adding them as "Embedded Resources"...
VB Code:
Dim myImage As System.Drawing.Image
'below, "MyProject" is the Assembly name (project name), Icon1.ico was an item added as an embedded resource (casing matters)
myImage = myImage.FromStream(System.Reflection.Assembly.GetExecutingAssembly.GetManifestResourceStream( _
"MyProject.Icon1.ico"))
'loads icon into a picturebox
PictureBox1.Image = myImage
Of course this doesnt solve the problem you are having, just thought I would throw that in there because this was one of the first times I have messed with embedded resources
-
Dec 28th, 2005, 04:01 PM
#5
Re: How to add more icons in exe?
Yes, thats internal to the program but the issue is to give the user the ability to change the shortcut icon to your app to one of the icons embedded in the exe.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Dec 28th, 2005, 04:19 PM
#6
Re: How to add more icons in exe?
Found a way to do it after you build your program. After it is built, open up the executable in Visual Studio (File > Open File). You get a tree with "Icon" and "version" as nodes. Right click the Icon Node, and choose "Insert Icon". It then brings you to an icon designer where you can create a new icon. I created a couple, then saved it, and was able to browse to the exe and have the new icons show up as well in the list when trying to change the icon in windows.
However, the catch to this is when the exectuable is rebuilt, this process has to be repeated, as the information is cleared out because of the new EXE overwrite...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|