Hi

I've just created my first application that registers an icon in the
taskbar. In the process I noted that my icon doesn't show up as external
file in the project, it seems to be registered as a resource somehow. Now
I'm wondering if I could add additional icons so that I don't have to
deliver them with the executable, but since I don't know how the first icon
belonging to the NotifyIcon has been added, there's no way I can duplicate
that process without adding another NotifyIcon.

Any ideas?

Regards
Stephan

Re: resource icons by hirf-spam-me-here

hirf-spam-me-here
Fri Jun 04 09:53:16 CDT 2004

* "Stephan Steiner" <steiner@isuisse.com> scripsit:
> I've just created my first application that registers an icon in the
> taskbar. In the process I noted that my icon doesn't show up as external
> file in the project, it seems to be registered as a resource somehow. Now
> I'm wondering if I could add additional icons so that I don't have to
> deliver them with the executable, but since I don't know how the first icon
> belonging to the NotifyIcon has been added, there's no way I can duplicate
> that process without adding another NotifyIcon.

Add the icon file to your project and set its 'Build Action' property to
'Embedded Resource'. You can use the code below to load the icon at
runtime:

\\\
foo.Icon = _
New Icon( _
[Assembly].GetExecutingAssembly().GetManifestResourceStream( _
"WindowsApplication1.Ball.ico" _
) _
)
///

'WindowsApplication1' is the root namespace of the application, "Ball.ico"
is the icon's filename.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>