.NET CF: New Form Icon Doesn't Appear

  • Thread starter Thread starter Jason D.
  • Start date Start date
J

Jason D.

Hi All,

I'm writing a C# app for PPC2k2, and I'm trying to give my forms a
custom icon. The .ico file has both 16X16/16-depth and 32X32/16-depth
images defined. I've added the .ico to the project and changed its
Build Action to "Embedded Resource". This successfully associates the
icon with the executable, and it shows up in the File Explorer.

My next step is to get the icon to show up on my forms, and here is
where I have problems. I've tried assigning the icon in the form
properties window, and I've tried changing the icon programatically
with the following code:

System.Reflection.Assembly oAssembly =
System.Reflection.Assembly.GetExecutingAssembly();

this.Icon = new Icon( oAssembly.GetManifestResourceStream(
this.GetType(),
"AppIcon.ico" ) );

this.Refresh();


Neither approach works, and now I'm stumped. Can anyone help?

TIA
 
Hi All,

I'm writing a C# app for PPC2k2, and I'm trying to give my forms a
custom icon. The .ico file has both 16X16/16-depth and 32X32/16-depth
images defined. I've added the .ico to the project and changed its
Build Action to "Embedded Resource". This successfully associates the
icon with the executable, and it shows up in the File Explorer.

My next step is to get the icon to show up on my forms, and here is
where I have problems. I've tried assigning the icon in the form
properties window, and I've tried changing the icon programatically
with the following code:

System.Reflection.Assembly oAssembly =
System.Reflection.Assembly.GetExecutingAssembly();

this.Icon = new Icon( oAssembly.GetManifestResourceStream(
this.GetType(),
"AppIcon.ico" ) );

this.Refresh();


Neither approach works, and now I'm stumped. Can anyone help?

TIA



The way I understand it is that the Form.Icon property is pretty much
useless on a PocketPC. There's no place for the icon to be shown.
Under WindowsCE.Net, this property shows the icon in the upper-left
corner of the titlebar, but since there's no per-window titlebar on a
PocketPC, just the Start menu bar, it doesn't get shown. Personally,
I've found that an "Embedded Resource" icon is all I need to have an
icon shown in utilities like WisBar or ICBar.

Was there somewhere you were expecting it to show up?

Mark Erikson
 
The way I understand it is that the Form.Icon property is pretty much
useless on a PocketPC. There's no place for the icon to be shown.
Under WindowsCE.Net, this property shows the icon in the upper-left
corner of the titlebar, but since there's no per-window titlebar on a
PocketPC, just the Start menu bar, it doesn't get shown. Personally,
I've found that an "Embedded Resource" icon is all I need to have an
icon shown in utilities like WisBar or ICBar.

Was there somewhere you were expecting it to show up?

Mark Erikson

I was trying to display it in the upper LH corner of the titlebar. I
don't suppose there's some workaround in PPC, like dynamically
changing the system icon?

TIA
 
The Windows flag logo is hard-coded, it may be that skinning programs along
the line of WindowBlinds and similar can overlay something else but you
can't do it from your .NETCF code - Plus it would break designed for Pocket
PC guidelines - since the icon is the startmenu and not a part of your
application anyway.

Peter

--
Peter Foot
Windows Embedded MVP

In The Hand
http://www.inthehand.com
 
[email protected] (Jason D.) wrote in message >news: said:
I was trying to display it in the upper LH corner of the titlebar. I
don't suppose there's some workaround in PPC, like dynamically
changing the system icon?

TIA


Just so I know I've got this right: are you trying to have your form's
icon replace the logo on the Start Menu? That's the way I'm reading
your description. If not, could you describe what exactly you're
trying to do in more detail?

Anyway, now that I've asked those questions... I can't really answer
yours :) I'm not exactly a PocketPC expert (currently working on my
first PPC project). That said, I would think that changing the Start
Menu icon is _possible_, given that skinning programs do it, but why
you'd want to do it is what I don't understand. Is this something
that seems necessary, or is it more of a "PC programs have an icon, I
ought to be able to do it on the PocketPC" kind of a thing? Most PPC
programs don't display icons outside of Explorer, at least as far as
I've seen.

Anyone out there who knows more on this subject than I do (which means
about everyone) feel free to jump in here.

Mark Erikson
 
Back
Top