ToolboxBitmap and resources

J

J-L

Hi,

I have created a new control and I need to pt it in the toolbox.
Actually, I have added a bitmap in ma solution and I code:

[ToolboxBitmap(typeof(OKButton), "button_ok.bmp")]
public class OKButton : Button

But, is it possible to use a bitmap in a .resx resources file ?

If yes, I don't find the syntax code.

Thanks for your help.

Jean-Luc (France)
 
M

Marc Gravell

Not as a resx AFAIK - but you can just mark the image file as an "Embedded
Resource" in the solution explorer, and use the name (in the way that you
are). The Type (typeof(OKButton) is used to get the resourcemanager - so the
image should be in the same project as IOKButon.

Marc
 
M

Marc Gravell

Note also that it (the image) often won't show in the toolbox when working
on the same project - only when working on a /separate/ project that
references it as binary.

Marc
 

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