Troubles with associating a Toolbox Bitmap with a Custom Control..

L

lhummel

Hi everybody,

I have a problem with a custom control developed in C#, and the bitmap
which I want to associate with it.

The custom control is functionally complete and working well; However,
I now wish to associate a bitmap other than the default "gear wheel",
when the control is placed on the VS toolbox.

I have tried to use the following declarations

namespace MyNamespace
{
/// <summary>
/// Summary description for MyClass.
/// </summary>
[ToolboxItem(true)]
[ToolboxBitmap(typeof(<bitmapfilename>)]
public class MyClass : System.Windows.Forms.UserControl
{
 
L

lhummel

Hi again...

I found out myself, so the problem is solved. However, for everybody
who might have the same troubles, here is what I did:

I right-clicked on the Project in Solution Explorer, and chose
"Properties". In the "Default Namespace" property field, I specified
the correct namespace for my component class (the namespace specified
previously happened to be wrong).

When I had done that and compiled the project, everything worked.

Hope that somebody can use this information.

Best regards,

L. Hummel, Denmark
 

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