Re: Icon class giving error
You can include the icon as a resource to your project.
In code you can do next:
Code:
Icon test = Properties.Resources.myIcon;
Re: Icon class giving error
Check if the file's "Copy to output directory" settings in files' properties in Solution Explorer. If you want to access it this way, it should be Copy...
Re: Icon class giving error
Quote:
Originally Posted by
l46kok
In my code, I'm trying to set an icon to a variable
Icon test = new Icon("systray.ico");
But this throws an exception and causes my program to crash if not handled (There should be no need to handle this)...
Also, any time that you are reading something from disk, you most certainly should handle any errors that may pop up.