Bitmap prb ?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Johnny (nimporte.quoi_at_nospam.fr)
Date: 04/19/04


Date: Mon, 19 Apr 2004 17:59:10 +0200

Hi all,

Sorry for me poor english

I'm creating a control derived from System.Windows.Forms.Control
I want my own bitmap to be displayed in the toolbox
I create a bitmap 16*16 called "Frame3D.BMP"
I create a resource file called "Frame3D.resources"
This resource file contains just one item : a System.Drawing.Bitmap
called Frame3D with my bitmap
I add the ressource file to my project
After compiling the resource file is included in the DLL.

The structure of the DLL is :
(-) Frame3D
    (-) frame3d.dll
        (-) Dependencies
                mscorlib
            (+) System.Windows.Froms
            (+) System.Drawing
            (+) System
        (-) Util.Winform.Ctrl
            (+) Frame3D
    (-) Resources
        (-) Frame3D.resources
            Frame3D : Bitmap

As regards source file, I wrote :
...
namespace Util.WinForm.Ctrl
{
...
    [ToolboxItem(true)]
    [ToolboxBitmap(typeof(Util.WinForm.Ctrl.Frame3D), "Frame3D")]
    public class Frame3D : System.Windows.Forms.Control
    {
    ...
    }
}

--> I'm sorry, it's C# but with VB.Net it's certainly something like
this :

...
Namespace Util.WinForm.Ctrl
...
        <ToolboxItem(True)> _
        <ToolboxBitmap(GetType(Util.WinForm.Ctrl.Frame3D), "Frame3D")> _
        Public Class Frame3D
        Inherits System.Windows.Forms.Control
                ...
        End Class
End Namespace

After compiling, I add the assembly (called Frame3D.dll) to the GAC
All works fine, the control works fine...

But when I add the control to the toolbox, I don't see my bitmap ? I
see something that looks like to a wheel ?
I use SharpDevelop 0.99b and tried with C#Builber Personal, but the
problem is the same...

A I mising something ?

Thanks

-- 
Ceci est une signature automatique de MesNews.
Site : http://mesnews.no-ip.com


Relevant Pages

  • problem with ToolboxBitmap ?
    ... I want my own bitmap to be displayed in the toolbox ... This resource file contains just one item: ... All works fine, the control works fine... ... But when I add the control to the toolbox, ...
    (microsoft.public.dotnet.framework.windowsforms.controls)
  • Re: problem with ToolboxBitmap ?
    ... My article on the toolbox bitmap might be useful to you ... > I create a bitmap 16*16 called "Frame3D.BMP"> I create a resource file called "Frame3D.resources"> This resource file contains just one item: a System.Drawing.Bitmap> called Frame3D with my bitmap ... > After compiling, I add the assembly to the GAC> All works fine, the control works fine... ...
    (microsoft.public.dotnet.framework.windowsforms.controls)
  • Re: Usercontrol icon
    ... In order to show an icon in the toolbox for your control you have to add it ... The icon in question should be in BMP rather than ICO format and it does not ... the bitmap will show in the toolbox only when you reference the ...
    (microsoft.public.dotnet.framework.windowsforms.controls)
  • Re: problem with ToolboxBitmap ?
    ... Add the bitmap to your project as a file and change the "Build Action" of it ... > After compiling the resource file is included in the DLL. ... > All works fine, the control works fine... ... > But when I add the control to the toolbox, ...
    (microsoft.public.dotnet.framework.windowsforms.controls)
  • setting bitmap on button
    ... my resource file for my Visual C++ GUI application. ... IDB_BITMAP1 with IDC_BUTTON_CONTROL. ... Bitmap=True on Properties for Button Control, but I haven't found where I ...
    (microsoft.public.vc.mfc)