Icons vs Bmp in Resource Files

  • Thread starter Thread starter Techno_Dex
  • Start date Start date
T

Techno_Dex

Does anyone have a way to import icons as bmps as "Linked" in Resource files
in the IDE? I need the ability to add icons to a resource file but have
them show up under the Images section with a file type of Windows Bitmap so
that they can be selected at Design Time through the IDE. I have read that
..NET 2.0 has issues with bmps and icons and the way they are stored
internally, but haven't found much supporting documentation on this.
Basically if I drop a new button on a form, then go to the properties window
and find the Image property, I can launch the "Select Resource" window which
will allow me to import a Project level resource into a resx file by using
the Import button. If I select an *.ico file, the file will show up in the
Images section of the Resource file with a file type of Bitmap. Now if I go
to the project and select the properties option from the context menu and
open up the Resources section the file I just imported is in the Images
section, but if I try the Add Resources -> Add Existing File and switch the
file type to *.* (All) and select another icon file the new icon is added
under the Icons section in the Resource file with a type of Icon. Is there
anyway to get around this? I know that an icon file is just a collection of
bitmaps with some header information to indicate the file size and a few
other things. In looking at the Resources.resx file in notepad, the only
difference in the XML is that the <Value> element has Bitmap after the name
of the icon. This again is completely different for Forms, as they expect
Icons which if added through the IDE will create a form level resource file
which is absolutely worthless. Another thought that might work would be if
I could read the Icons from the Resource file at Design Time but make them
selectible via the IDE by creating my own wrapper class somehow which would
allow the icons to be selected that way.

TIA
 
Edit the icon, and copy the bitmap you want to use. Save it as a file and
add it as a bitmap resource.

--
HTH,

Kevin Spencer
Chicken Salad Surgeon
Microsoft MVP
 
Back
Top