ToolboxBitmap and resources

  • Thread starter Thread starter J-L
  • Start date Start date
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)
 
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
 
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
 
Back
Top