Application icon not displaying

Application icon not displaying

Post by Richard Le » Tue, 27 Apr 2004 04:51:11


Can anyone tell me why an application's icon would not show?

The test pocket pc is an old ipaq 36xx running 2002. I've built an
application in C#.NET and deployed it to the application via the visual
studio debug deployed. Once on the target test device, the icon I see from
file explorer and on the top caption bar is not the one I specified in the
build. Instead, its that right cornered folded down thing with smaller
squares inside.

In the solution properties, I've specified the icon file. That didn't seem
to make any difference so I changed the build action to embedded for the
icon file and did the stuff necessary to load an embedded resource.

using System.Reflection;

In the main form's load, I've added
this.Icon = new System.Drawing.Icon(
Assembly.GetExecutingAssembly().GetManifestResourceStream("Pocket_Spider.Spi
der.icon") );

Oddly, I'm still getting the wrong icon. I read that the icons are cached
and that you have to soft reset the machine to get new icons. Pushed the
soft reset button. No change.

Obviously, I'm doing something wrong since it can't be this hard to get an
application icon working right. I would be ever so grateful if someone could
point me in the right direction.

==========

Richard Lewis Haggard
 
 
 

Application icon not displaying

Post by Peter Foot » Tue, 27 Apr 2004 16:26:43

The application icon is specified differently from the form icon. In Project
Properties you can set the application icon, this is stored as a native icon
resource (rather than a manifest item as with any embedded resource items).
Once you've done this and rebuilt and deployed the project you will need to
soft-reset to clear the icon cache.

The icon you specify must include both 16x16 and 32x32 versions if you want
the best display on both the Programs folder and Start Menu. There should be
a 256 colour version for best display on most devices.

Peter

--
Peter Foot
Windows Embedded MVP
OpenNETCF.org Senior Advisor
www.inthehand.com | www.opennetcf.org

 
 
 

Application icon not displaying

Post by Peter Foot » Tue, 27 Apr 2004 18:58:49

There is some further information in a previous blog post, including a
working .ico file which you can use as a starting point to build a working
application icon.
http://www.yqcomputer.com/

Peter

--
Peter Foot
Windows Embedded MVP
OpenNETCF.org Senior Advisor
www.inthehand.com | www.opennetcf.org
 
 
 

Application icon not displaying

Post by Richard Le » Thu, 29 Apr 2004 03:15:44

es, I see. Light has dawned on Marble Head (That's a Boston joke. We have a
Marblehead up here. Never mind.) The problem was that I was unfamiliar with
how Visual Studio.Net does its icon editing. The application is, in fact,
using its icon. It just wasn't the version of the icon that I thought it
was. It was using the default 16x16 version, not the 16x16 256 color that
I'd been drawing. Now I've done something that is causing the build to fail
("Unspecified error on spider.icon") but that's another issue.

Thank you.
==========
Richard Lewis Haggard

"Peter Foot [MVP]" < XXXX@XXXXX.COM > wrote in message
news: XXXX@XXXXX.COM ...
http://blog.opennetcf.org/pfoot/PermaLink.aspx?guid=bc8a9304-112d-4fb7-b9f7-512f62e2d8df
the
Assembly.GetExecutingAssembly().GetManifestResourceStream("Pocket_Spider.Spi
cached
the