resource icons

  • Thread starter Thread starter Stephan Steiner
  • Start date Start date
S

Stephan Steiner

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
 
* "Stephan Steiner said:
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.
 
Back
Top