|
-
Aug 25th, 2007, 12:13 PM
#1
Thread Starter
Addicted Member
Icon
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
-
Aug 25th, 2007, 01:23 PM
#2
Re: Icon
Did you set the icons property to Embedded resource instead of Content?
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Aug 26th, 2007, 12:07 AM
#3
Thread Starter
Addicted Member
Re: Icon
 Originally Posted by RobDog888
Did you set the icons property to Embedded resource instead of Content?
Yes, I did . But If I change the code to this
Code:
m_notifyicon.Icon = new System.Drawing.Icon(@"C:\Documents and Settings\Administrator\My Documents\Visual Studio 2005\Projects\WindowsApplication6\WindowsApplication6\Icon1.ico");
It work. But I would like to understand why?
Thanks
-
Aug 26th, 2007, 11:32 PM
#4
Re: Icon
You didn't import the correct classes.
At the top of the class file you should have added
-
Aug 27th, 2007, 07:52 AM
#5
Re: Icon
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|