change the default gear icon next to control

  • Thread starter Thread starter dantheman
  • Start date Start date
D

dantheman

Hi All,

I've made SmartDevice control with Visual Studio 2005 Pro full version
and compiled it now when it apears in the toolbox it displays the
default gear icon next to the control what do i need to do to have my
own icon to display next to my control

thank all
 
Add an bmp file to your project with the same name as the class and set it
to embedded resource. So if your class is named MyClass then add a bmp called
MyClass.bmp as an embedded resource.

Also, in your xmta file you can also set the ToolboxBitmap attribute. For
example:

<Class Name="MyNameSpace.MyClass">
<ToolboxBitmap>MyNameSpace.Button2</ToolboxBitmap>
</Class>

HTH
________________________________________
Mark Arteaga
..NET Compact Framework MVP
http://www.opennetcf.com | http://blog.markarteaga.com
 
I'm upgrading my control library from VS2003 / CF 1 to VS2005 / CF 2.
I've been trying for the last hour to get this to work and haven't been
able to. My control is a button called imsmButton in a project called
imForms, in a namespace called Controls (Hence, the full name is
imForms.Controls.imsmButton). I've got a folder in my project for the
images called "Images". I added the bitmap as
imForms.Controls.imsmButton.bmp to this folder. It's not being picked
up by toolbox. I've tried adding the attribute to the xmta file, and
tried every combination I can think of for the value there. Nothing
seems to work.

Ideally, I would prefer to not have to include the image in my
assembly. I've got 20+ controls in this assembly, and while these
bitmaps aren't big by any means, they do add to the size of the
assembly when its deployed to the device. So if there was a way to put
them in a special assembly containing the toolbox images that I didn't
deploy to the device but was used at design time for the toolbox icons,
that would be preferable. Most of my icons are the standard windows
forms icons (I've subclassed most of the windows controls to meet my
own needs). So if there was a way to just point the icon to those,
that would be best.

Thanks,
Myron
 
Back
Top