Application icon not displaying

  • Thread starter Richard Lewis Haggard
  • Start date
R

Richard Lewis Haggard

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
 
P

Peter Foot [MVP]

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
 
R

Richard Lewis Haggard

Yes, 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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top