If you want to create them from scratch use the following method (VB6 only)
Code:
Private Sub Command1_Click()
Controls.Add "VB.TextBox", "Text1"
Me!Text1.Move 0, 0
Me!Text1.Caption = "Text1"
Me!Text1.Visible = True
End Sub
If you have VB5, use CreateWindowEx API
Code:
Private Declare Function CreateWindowEx Lib "user32" Alias "CreateWindowExA" (ByVal dwExStyle As Long, ByVal lpClassName As String, ByVal lpWindowName As String, ByVal dwStyle As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hWndParent As Long, ByVal hMenu As Long, ByVal hInstance As Long, lpParam As Any) As Long
Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Const WS_CHILD = &H40000000
Private WithEvents btn As CommandButton
Private Sub Form_Load()
retval = CreateWindowEx(0&, "Edit", "Edit1", WS_CHILD, 32, 32, 64, 64, Me.hwnd, 0, App.hInstance, ByVal 0&)
ShowWindow retval, 1
End Sub