Can anyone tell me what is wrong with this code ?
m_notifyicon.Icon = new Icon(this.GetType() ,"Icon1.ico");
I have this error' Icon1.ico not found in class "Win..."
Resource
Thanks
Printable View
Can anyone tell me what is wrong with this code ?
m_notifyicon.Icon = new Icon(this.GetType() ,"Icon1.ico");
I have this error' Icon1.ico not found in class "Win..."
Resource
Thanks
Did you set the icons property to Embedded resource instead of Content?
Quote:
Originally Posted by RobDog888
Yes, I did . But If I change the code to this
It work. But I would like to understand why?Code:m_notifyicon.Icon = new System.Drawing.Icon(@"C:\Documents and Settings\Administrator\My Documents\Visual Studio 2005\Projects\WindowsApplication6\WindowsApplication6\Icon1.ico");
Thanks:confused:
You didn't import the correct classes.
At the top of the class file you should have added
vb Code:
using System.Drawing;
If you pass this.GetType() as the first parameter you're specifying that the icon is an embedded resource belonging to the current class. In your second sample you're not doing that.