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