Toolbox Icon for a new custom control 
Author Message
 Toolbox Icon for a new custom control

Hi ,

You can try the following.
In order to embed the bitmap file in the resource file of the component
DLL, you can follow the steps as below:
1.        In your component project, go to the Project menu and select Add
New Item. Select Bitmap File, rename the file to the same name as your
component class. (For example, suppose your component is named WinWebComp,
the file name should be WinWebComp.bmp.)
2.       Select the bitmap from the Bitmap Designer window and press the F4
key to pull-out the Properties window for the bitmap. Change the Height and
Width property to 16 each and make sure that the Colors property is set to
16 Colors. Once the properties have been set, design the bitmap in the way
as you wish.
NOTE: Make sure to use the 16x16x16 bitmap for it to be rendered properly
in VS.NET designer.
3.       Go to the Solutions Explorer and select the bitmap file (say
WinWebComp.bmp) item from it and press the F4 key to bring out the
Properties Explorer for the Bitmap file. (NOTE: This is different from the
Bitmap properties in the above step.) From the Build Action property select
Embed Resource, so that the bitmap file is embed into your assembly as a
4.       Right-click on the Project in the Solution Explorer and select
Properties from the context menu. In the Properties dialog set the Default
Namespace property to the correct namespace of your component class.
      NOTE: This step is very import. Otherwise, the bmp file embedded in
the assembly cannot be found successfully.
5.       Remove the ToolboxBitmap attribute from the component class. (You
don't need to specify this attribute now.)
6.       Recompile the project

Elan Zhou
This posting is provided "AS IS" with no warranties, and confers no rights.
Got .Net?   http://www.*-*-*.com/

Tue, 01 Feb 2005 13:56:12 GMT  
 [ 1 post ] 

 Relevant Pages 

1. Adding a Custom Control to the VS.NET Toolbox

2. Installing custom controls in ToolBox

3. Custom user controls Not being added to ToolBox

4. Custom Controls in Toolbox

5. Adding Custom Controls to Toolbox

6. Custom Inherited User Control Doesn't Show Up in Toolbox

7. Toolbox Icon for ActiveX control

8. Toolbox Icon for ActiveX control

9. create custom icon,custom combobox in custom toolbar

10. create custom icon,custom combobox(to insert values)in custom toolbar

11. ToolBox Graphic for custom OCX

12. Assigning a custom Icon to an ActiveX control


Powered by phpBB® Forum Software