UserControl newbie question

L

Luis Arvayo

A UserControl in a Windows Forms application can be placed several times on
forms of the application or do I need to create a Control Library for doing
that ?

I did a UserControl in my App, but I cannot drag that control to other
forms.

Thanks
 
L

Landley

Put the user control in a separate DLL. Build it, add new item to the
Toolbox, and browse for the dll.

You should then be able to drag your control onto a form as many times as
you wish.

L.
 
B

Bruce Wood

You should be able to copy and paste it.

Or, you can add some other kind of control (like a Panel), then edit
the declaration and the "new" statement to instantiate your user
control instead.

Or if your user control is in the same project (assembly) as your form,
you can click "User Controls" in the toolbar when you're in Desigher
mode, and it should show you your user controls and allow you to drag
them onto the form.

Or you can put your user control in a DLL and add that DLL to the
toolbar so that you can use your user control to any form in any
project that references the DLL.
 
L

Luis Arvayo

Or if your user control is in the same project (assembly) as your form,
you can click "User Controls" in the toolbar when you're in Desigher
mode, and it should show you your user controls and allow you to drag
them onto the form.


Thanks a lot !

I have not detected this option. It was really very helpful.
 

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

Similar Threads


Top