Compile app with icons

  • Thread starter Thread starter Christian Reizlein
  • Start date Start date
C

Christian Reizlein

How can i compile my application with more than 1 icon ? i have tryied
adding external .ico to the solution and settign them to content or resource
but then they are not visible as normal icons of the file, just the primary
one is.

I need my app to include 3 icons in its .exe so i can use them in explorer
extensions for windows.

Thanks,
Christian
 
You can add an icon to each form, or use a resource file to load into an
image control.
 
Hi Christian,

VB doesn't expose this as such (at least not that I know of). If you aren't
singing your app, you can modify the app's Win32 resource file by opening
the exe in Visual Studio (you may need to have C++ instaleld for that, not
sure). Generally though, that's a real pain in the .... you know where ...
<g>, so what I do is use a satellite dll or multiples of as native resource
dlls as opposed to managed resource dll's.
 
How can i compile my application with more than 1 icon ? i have tryied
adding external .ico to the solution and settign them to content or resource
but then they are not visible as normal icons of the file, just the primary
one is.

I need my app to include 3 icons in its .exe so i can use them in explorer
extensions for windows.

This may be possible with vs 2005 project resources, but I don't know
anything about that.

The way I do it is from vs 2003 (and I still use it in vs2005) is as follows.

1. Add the .ico files to your project (Project, Add Existing Item).
2. For each file, set its Build Action to Embedded Resource (select the
file, look in the Properties window).
3. Access the icon as in the code below. If you added "lighton.ico", use

Dim s As String = Application.ProductName & ".lighton.ico"
Icon = New
Icon(Reflection.Assembly.GetExecutingAssembly.GetManifestResourceStream(s))
 
Back
Top