ToolboxBitmap control problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Luis Arvayo

    ToolboxBitmap control problem

    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(t ypeof(MyControl ), "foo.Resources. MyControl.bmp")]
    public class MyControl : System.Componen tModel.Componen t
    Anyone have an idea ?

    Thanks


  • Cletus Van Damme

    #2
    Re: ToolboxBitmap control problem

    "Luis Arvayo" <amorenopalma@p rodigy.net.mx> wrote in message
    news:OtvA4xEfFH A.2152@TK2MSFTN GP14.phx.gbl...[color=blue]
    > 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(t ypeof(MyControl ), "foo.Resources. MyControl.bmp")]
    > public class MyControl : System.Componen tModel.Componen t
    > Anyone have an idea ?
    >
    > Thanks
    >[/color]

    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(t ypeof(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


    Comment

    Working...