adiing textbox..at runtime

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

hi there
i want to add the textboxes on my form at runtime
equal to the number ..say two as per the input
is it possible?
 
Private Sub UserForm_Initialize()
Dim newCtrl As Control, num As Integer
num = 2
For i = 1 To num
Set newCtrl = _
Me.Controls.Add("Forms.TextBox.1", _
"txtBox" & i, True)
newCtrl.Top = 30 * i
Next i
End Sub
 
million thanks JW
--
hemu


JW said:
Private Sub UserForm_Initialize()
Dim newCtrl As Control, num As Integer
num = 2
For i = 1 To num
Set newCtrl = _
Me.Controls.Add("Forms.TextBox.1", _
"txtBox" & i, True)
newCtrl.Top = 30 * i
Next i
End Sub
 
Back
Top