The process is pretty easy and straight forward.
1) Declare a new variable of the control's type (in our example a Button)
2) Set its properties like its text, size, location, visibility etc like you would any other control
3) Add it to the form by adding it to the forms list of controls (it is actually a collection of controls called "controls"... pretty fitting huh?)
The steps above are demonstrated below in a click event of our button called "btnAddButton"
CODE
Private Sub btnAddButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAddButton.Click
' Declare a new button variable (hence the keyword 'New')
Dim newbutton As New Button
' Give it some text
newbutton.Text = "New Button"
' Lets set its position
newbutton.Top = 10
newbutton.Left = 10
' Finally, add it to the list of the form's controls.
Me.Controls.Add(newbutton)
End Sub
You can see the steps I mentioned above in the example. We create a new variable of type "Button", we give it some text and set its location on the form (it will start at 10,10 from the upper left corner) and we then add it to the forms controls collection using the add method. (Me represents the current object... the form).
The result is a button with the text "New Button" in the upper left corner of the form when we click our add button.
Hope that makes sense and gives you an idea of how you can add controls dynamically. Enjoy!
"At DIC we be control adding code ninjas!"