That was exactly the problem. Thank you very much for your assistance.

Pierre

-----------------------------------------------
Pierre Greborio
[EMAIL PROTECTED]
http://www.pierregreborio.it
-----------------------------------------------



-----Original Message-----
From: dotnet discussion [mailto:[EMAIL PROTECTED]] On Behalf Of
Ian Griffiths
Sent: Wednesday, May 29, 2002 11:32 AM
To: [EMAIL PROTECTED]
Subject: Re: [DOTNET] ToolboxBitmap bug ?


Go and look at the default namespace property for your project.  (When
you create a project this will be the same name as the assembly by
default.) You can see this by right-clicking on the project (the
project, not the
solution) in the Solution Explorer, and selecting Properties.  The
Default Namespace property is in the General section of Common
Properties.

VS.NET will prepend whatever is set as the Default Namespace to all
embedded resources.  (Which is kind of annoying, but I don't know of a
way of turning this behaviour off.)  This is almost certainly the cause
of the problem you are seeing.


--
Ian Griffiths
DevelopMentor

----- Original Message -----
From: "Pierre Greborio" <[EMAIL PROTECTED]>


> It happens something strange. In the manifest there is the assembly
> name added MyAssembly.MyNamespace.MyControl.bmp whereas the filename
> is MyNamespace.MyControl.bmp.
>
> Pierre
>
> -----Original Message-----
> From: Ian Griffiths
>
> Did you actually call the BMP file "MyNamespace.MyControl.bmp"?  As
> opposed to "MyControl.bmp"?  VS.NET always puts in the default
> namespace for you, so if you put that into the filename yourself it
> will be in there twice!
>
> Look at your compiled component with ILDASM.  All the embedded
> resources are listed in the MANIFEST.  You'll see what they are really

> called there.
>
> Also, remember these things are case sensitive - check the case is
> correct.
>
> --
> Ian Griffiths
> DevelopMentor
>
> ----- Original Message -----
> From: "Pierre Greborio" <[EMAIL PROTECTED]>
>
> > I've written a custom control and I need to create my own image. The

> > control is MyNamespace.MyControl and the bitmap (16x16) is
> > MyNamespace.MyControl.bmp (build as embedded resource). If I set the

> > attribute ToolboxBitmap with the filename it correctly show the
> > image,
>
> > if I set with type ToolboxBitmap(typeof(MyNamespace.MyControl)) it
> > shows the default image and not my own. Is it a bug ?

You can read messages from the DOTNET archive, unsubscribe from DOTNET,
or subscribe to other DevelopMentor lists at http://discuss.develop.com.

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to