C
Charles Zhang
I created a class that derives from DbConnection class(in turn derives
from Component Class).
I specified a ToolboxBitmapAttribute for the class like:
[ToolboxBitmap(typeof(SpeedyDbConnection),
"Bitmaps.SpeedyDbConnection.bmp")]
Correct bitmap is shown in the component tray of a form. However, the
default bitmap (not the one I specified) is shown on the toolbox.
According to the following link, specify the ToolboxBitmap is all I need
to do.
http://msdn2.microsoft.com/en-us/library/4wk1wc0a(vs.80).aspx
But the document for ToolboxBitmapAttribute class says:
"Allows you to specify an icon to represent a control in a container,
such as the Microsoft Visual Studio Form Designer.". I am not sure if
"ToolBox" is a kind of container.
So I created my own ToolBoxItem class ( a class that derives from
ToolBoxItem) and specify the "BitMap" property using my own bitmap. I
debugged into my own ToolBoxItem class when I added the component into
the toolbox, the BitMap property was changed as I am expecting, but the
toolbox is still showing wrong bitmap.
I would like someone to point out what I am doing wrong here.
Thanks
Charles Zhang
from Component Class).
I specified a ToolboxBitmapAttribute for the class like:
[ToolboxBitmap(typeof(SpeedyDbConnection),
"Bitmaps.SpeedyDbConnection.bmp")]
Correct bitmap is shown in the component tray of a form. However, the
default bitmap (not the one I specified) is shown on the toolbox.
According to the following link, specify the ToolboxBitmap is all I need
to do.
http://msdn2.microsoft.com/en-us/library/4wk1wc0a(vs.80).aspx
But the document for ToolboxBitmapAttribute class says:
"Allows you to specify an icon to represent a control in a container,
such as the Microsoft Visual Studio Form Designer.". I am not sure if
"ToolBox" is a kind of container.
So I created my own ToolBoxItem class ( a class that derives from
ToolBoxItem) and specify the "BitMap" property using my own bitmap. I
debugged into my own ToolBoxItem class when I added the component into
the toolbox, the BitMap property was changed as I am expecting, but the
toolbox is still showing wrong bitmap.
I would like someone to point out what I am doing wrong here.
Thanks
Charles Zhang