Compile app with icons

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
 
D

David Glienna

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

Bill McCarthy

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.
 
A

AMercer

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))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top