How to add control/component to the IDE toolbar

M

Mike

I've been trying to create a VB.NET window control and add it to the
toolbar where a vb.net form application can click, drag and drop into
his form.

Been reading all the MSDN docs and can't seem to find how this is
done. I'm sure its very simple and I'm over thinking something.

In VB6 it was easy because I could right click the toolbar and add
the control. The right click property window under VS2005 toolbar
has a "Show Items..." but no "add control" idea. It has an Add Tab but
no add control.

Can someone steer me right here? It will be greatly appreciated.

Thanks

--
 
T

Tom Shelton

I've been trying to create a VB.NET window control and add it to the
toolbar where a vb.net form application can click, drag and drop into
his form.

Been reading all the MSDN docs and can't seem to find how this is
done. I'm sure its very simple and I'm over thinking something.

In VB6 it was easy because I could right click the toolbar and add
the control. The right click property window under VS2005 toolbar
has a "Show Items..." but no "add control" idea. It has an Add Tab but
no add control.

Can someone steer me right here? It will be greatly appreciated.

Thanks

--

When you right click, do you see a "Choose Items" option?
 
T

Tom Shelton

I've been trying to create a VB.NET window control and add it to the
toolbar where a vb.net form application can click, drag and drop into
his form.

Been reading all the MSDN docs and can't seem to find how this is
done. I'm sure its very simple and I'm over thinking something.

In VB6 it was easy because I could right click the toolbar and add
the control. The right click property window under VS2005 toolbar
has a "Show Items..." but no "add control" idea. It has an Add Tab but
no add control.

Can someone steer me right here? It will be greatly appreciated.

Thanks

--

When you right click, do you see a "Choose Items" option?
 
J

joecool1969

I've been trying to create a VB.NET window control and add it to the
toolbar where a vb.net form application can click, drag and drop into
  his form.

Been reading all the MSDN docs and can't seem to find how this is
done. I'm  sure its very simple and  I'm over thinking something.

In  VB6  it was easy because I could right click the toolbar and add
the control.   The right click property window under VS2005 toolbar
has a "Show Items..." but no "add control" idea. It has an Add Tab but
no add control.

Can someone steer me right here?  It will be greatly appreciated.

I assume the custom control has been compiled into a DLL. You may want
to create a tab just to store custom controls or not. Drag and drop
the DLL file into the tab of your choice in the toolbox.

Simple, eh?
 
J

joecool1969

I've been trying to create a VB.NET window control and add it to the
toolbar where a vb.net form application can click, drag and drop into
  his form.

Been reading all the MSDN docs and can't seem to find how this is
done. I'm  sure its very simple and  I'm over thinking something.

In  VB6  it was easy because I could right click the toolbar and add
the control.   The right click property window under VS2005 toolbar
has a "Show Items..." but no "add control" idea. It has an Add Tab but
no add control.

Can someone steer me right here?  It will be greatly appreciated.

I assume the custom control has been compiled into a DLL. You may want
to create a tab just to store custom controls or not. Drag and drop
the DLL file into the tab of your choice in the toolbox.

Simple, eh?
 
M

Mike

I assume the custom control has been compiled into a DLL. You may want
to create a tab just to store custom controls or not. Drag and drop
the DLL file into the tab of your choice in the toolbox.

Simple, eh?

I hope it was :)

Right. It had a General tab, so I added a Wildcat tab. From solution
explorer, I tried dragging the project name, but only took the
CustomControl1.vb file shows up as:

- Wildcat
Pointer
TEXT: full path name to file.

You mean, compile the DLL, Show all files, and drag and drop the
bin\*.dll into the custom tab? Let me try that....

Same thing, just shows:

TEXT: Full path to dll file

When I bring up another test Windows Form application, I don't see see
this the Tab. I also tried adding a reference to the DLL.
 
M

Mike

I assume the custom control has been compiled into a DLL. You may want
to create a tab just to store custom controls or not. Drag and drop
the DLL file into the tab of your choice in the toolbox.

Simple, eh?

I hope it was :)

Right. It had a General tab, so I added a Wildcat tab. From solution
explorer, I tried dragging the project name, but only took the
CustomControl1.vb file shows up as:

- Wildcat
Pointer
TEXT: full path name to file.

You mean, compile the DLL, Show all files, and drag and drop the
bin\*.dll into the custom tab? Let me try that....

Same thing, just shows:

TEXT: Full path to dll file

When I bring up another test Windows Form application, I don't see see
this the Tab. I also tried adding a reference to the DLL.
 
M

Mike

Tom said:
When you right click, do you see a "Choose Items" option?

Phew! I finally got it. Can you tell me if there is a more straight
forward IDE procedure or this the following is basically correct?

--------------------
How to create a NON-UI Toolbox Component that will
appear in the Component Tray (not on a Windows form)
when dropped on a form.

Step 1) Create a New Project selecting the Class Library template.

Step 2) For the new project, click PROJECT | ADD COMPONENT

Step 3) Compile and create the DLL

Adding the component to the Toolbox

You can add the component to the Toolbox General Tab or create a new
tab in the Toolbox. In this example, the General tab is used.

Step 4) Select the general tab in the Toolbox, right click and select
"Choose Items..."

Step 5) Click Browse and find the location of your DLL, click OK.

The component *SHOULD* appear in the toolbox General tab.

o Testing

Step 6) Create a new Windows Application project.

Step 7) Display the form and drop the component.

The component *SHOULD* appear in the COMPONENT TRAY at the bottom of
the form display.
--------------------

Overall, what I found, unless I did something wrong, selecting a
Windows Control Library Project did not work. This creates a UI user
control. I had to create a class library then add a component to it.
Simple of course, but if you never done it before, it isn't obvious.

In short, IMO, there should be a new project template called:

Windows Component Library

with a description

A project for creating NON-UI ToolBox components to use in Windows
applications

Is there some IDE method that does this?

I believe I saw convert options somewhere, don't recall where, maybe
in the class explorer, that saids

Convert Class to Component ...
Convert Class to Control ...

That is what give me the idea of doing the steps above because I
didn't recall where these options were at.

Anyway, maybe this will help the next .NET newbie because every
example I found on MSDN and else where was for creating UI components. :)

Thanks for all your input.

--
 
M

Mike

Tom said:
When you right click, do you see a "Choose Items" option?

Phew! I finally got it. Can you tell me if there is a more straight
forward IDE procedure or this the following is basically correct?

--------------------
How to create a NON-UI Toolbox Component that will
appear in the Component Tray (not on a Windows form)
when dropped on a form.

Step 1) Create a New Project selecting the Class Library template.

Step 2) For the new project, click PROJECT | ADD COMPONENT

Step 3) Compile and create the DLL

Adding the component to the Toolbox

You can add the component to the Toolbox General Tab or create a new
tab in the Toolbox. In this example, the General tab is used.

Step 4) Select the general tab in the Toolbox, right click and select
"Choose Items..."

Step 5) Click Browse and find the location of your DLL, click OK.

The component *SHOULD* appear in the toolbox General tab.

o Testing

Step 6) Create a new Windows Application project.

Step 7) Display the form and drop the component.

The component *SHOULD* appear in the COMPONENT TRAY at the bottom of
the form display.
--------------------

Overall, what I found, unless I did something wrong, selecting a
Windows Control Library Project did not work. This creates a UI user
control. I had to create a class library then add a component to it.
Simple of course, but if you never done it before, it isn't obvious.

In short, IMO, there should be a new project template called:

Windows Component Library

with a description

A project for creating NON-UI ToolBox components to use in Windows
applications

Is there some IDE method that does this?

I believe I saw convert options somewhere, don't recall where, maybe
in the class explorer, that saids

Convert Class to Component ...
Convert Class to Control ...

That is what give me the idea of doing the steps above because I
didn't recall where these options were at.

Anyway, maybe this will help the next .NET newbie because every
example I found on MSDN and else where was for creating UI components. :)

Thanks for all your input.

--
 
M

Mike

It adds what looks to be a generic stub icon - a cyan colored gear
(circle with teeth) icon. I presumed I would be able to add one to
the component resources. I don't see a property for it, only three:

+ Design
(NAME) : WildcatComponent
Language : (Default)
Localizable: FALSE

Thanks
 
M

Mike

It adds what looks to be a generic stub icon - a cyan colored gear
(circle with teeth) icon. I presumed I would be able to add one to
the component resources. I don't see a property for it, only three:

+ Design
(NAME) : WildcatComponent
Language : (Default)
Localizable: FALSE

Thanks
 
M

Mike

Piece of cake!

<ToolboxBitmapAttribute(GetType(WildcatComponent), "cateyes.ico")> _
Public Class WildcatComponent
End Class

Using this method, change the icon file properties Build Action to
Embedded Resource.

..NET ROCKS!

--
 
M

Mike

Piece of cake!

<ToolboxBitmapAttribute(GetType(WildcatComponent), "cateyes.ico")> _
Public Class WildcatComponent
End Class

Using this method, change the icon file properties Build Action to
Embedded Resource.

..NET ROCKS!

--
 

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