ToolboxBitmap control problem

L

Luis Arvayo

Hi All,

I cannot made visible the toolbox bitmap for my controls.
I did the following:

- Namespace : foo
- Assembly: foo.dll
- Toolbox bitmap stored in subdirectory Resources. Resource bitmap defined
as embedded resource: MyControl.bmp
- Then the control toolboxbitmap attribute is defined like this:

[ToolboxBitmap(typeof(MyControl), "foo.Resources.MyControl.bmp")]
public class MyControl : System.ComponentModel.Component
Anyone have an idea ?

Thanks
 
C

Cletus Van Damme

Luis Arvayo said:
Hi All,

I cannot made visible the toolbox bitmap for my controls.
I did the following:

- Namespace : foo
- Assembly: foo.dll
- Toolbox bitmap stored in subdirectory Resources. Resource bitmap defined
as embedded resource: MyControl.bmp
- Then the control toolboxbitmap attribute is defined like this:

[ToolboxBitmap(typeof(MyControl), "foo.Resources.MyControl.bmp")]
public class MyControl : System.ComponentModel.Component
Anyone have an idea ?

Thanks

I just did my first user control the other day and got the ToolboxBitmap to
work like this:

- Add MyControl.bmp to the project, in the same directory as MyControl.cs.
- Set the Build Action for MyControl.bmp to "Embedded Resource"
- Add the following attribute to the MyControl class:
[ToolboxBitmap(typeof(MyControl))]

Worked like a champ. It may be possible to do it another way but like I
said this was my first go at a user control so I'm no expert.

Good luck.

CVD
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top