Compact Framework form icon management

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I can't seem to get a certain .ico to load at runtime.

This line:
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
Always raises this error:
An unhandled exception of type 'System.NotSupportedException' occurred in
System.Drawing.dll

Anybody aware of any gotchas in the way the Compact Framework handles form
icons?

Thanks
 
Thanks, Tim.

In this case, it turns out the problem had to do with the file format - too
many colors. We are using a Photoshop plugin to create the .ico files. It is
necessary to set the PS "image mode" to "indexed".

Too bad the error can't be a little more descriptive :)
 
Too bad the error can't be a little more descriptive
Definitely. The more information given in the exception the easier it would
be to track down.

Just for future reference, the official CF newsgroup is here
(microsoft.public.dotnet.framework.compactframework). You'll usually get a
faster response in this targeted newsgroup.
 
Back
Top