Icon assignment 
Author Message
 Icon assignment

Hi y'all,

I have added a 16x16 icon to my project..  I want to assign it to a
NotifyIcon.  So I do:

    Icon ic=new Icon(???);
    notifyIcon1.Icon=ic;

I'm having trouble with the parameters.  The icon name is "TestIcon" (that's
what I named it when VS creted for me).  I don't want to put in a fixed file
name.  i suspect i need to specify a Type, but I've failed to hit the right
solution.

Any help would be appreciated.

Thanx,
Bill



Thu, 09 Jun 2005 02:21:17 GMT  
 Icon assignment
You can set the icon as an embedded resource, setting the "build action".
And then...

Stream iconStream =
Assembly.GetExecutingAssembly().GetManifestResourceStream("DefaultNamespace.
Icon1.ico");
Icon icon1 = new Icon(iconStream);


Quote:
> Hi y'all,

> I have added a 16x16 icon to my project..  I want to assign it to a
> NotifyIcon.  So I do:

>     Icon ic=new Icon(???);
>     notifyIcon1.Icon=ic;

> I'm having trouble with the parameters.  The icon name is "TestIcon"
(that's
> what I named it when VS creted for me).  I don't want to put in a fixed
file
> name.  i suspect i need to specify a Type, but I've failed to hit the
right
> solution.

> Any help would be appreciated.

> Thanx,
> Bill



Fri, 10 Jun 2005 06:21:40 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. warning: ambiguous assignment: assignment op taken

2. Icon to Bitmap, which icon size being copied?

3. Shortcut icon/bitmap on application icon: How ?

4. Loading an icon in the taskbar (beside the time) -- like the volume icon

5. Tray Icon without Taskbar Icon

6. Big icon, small icon, How to

7. CButton icon question - Removing icon

8. .exe Icon is not the same as the application icon

9. Adding single Icons to Imagelist (+ How to create a mask for icon)

10. Hide taskbar icon on application startup (show only task tray icon)

11. big icons and little icons...

12. Shortcut icon/bitmap on application icon: How?

 

 
Powered by phpBB® Forum Software