Adding User Controls to Form During Design-Time

vendiddy

Well-known member
Joined
May 14, 2006
Messages
64
Programming Experience
1-3
I am trying to create a user control with a text box which takes input for a keystroke combination (a shortcut). For example, if you press the control key, the alt key, and the s key, "CTRL + ALT + S" should show up in the text box.

I am only able to add this user control to my form during runtime using:
VB.NET:
Expand Collapse Copy
[SIZE=2]
Me.Controls.Add([/SIZE][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][SIZE=2] ShortcutInput)
[/SIZE]

Is there a way I can add this control during design time instead? It doesn't just let me drag and drop the user control from the solution explorer.
 
Designer Toolbox lists usercontrols in current project at top of list, if the project is WindowsApplication1 it says "WindowsApplication1 Components" there.

If usercontrol is from a separate class library you must use contextmenu on Toolbox and select "Choose items..." or main menu Tools > "Choose Toolbox Items..". Then you browse to the dll and all controls in that library is available in the .Net tab to choose.
 
Back
Top