Any one can give some codes on how to add textbox at runtime? Let say i have one textbox in a form then when you run it in a load event it will add another textbox?
any suggestions are accepted...
Start a new project and add a text box to Form1. In the properties window set it's index to 0 (zero). Then place the following code in the form.
[tt]
Option Explicit
Private Sub Form_Load()
Dim I As Integer
Text1(0).Left = 30
Text1(0).Top = 30
For I = 1 To 3
Load Text1(I)
Text1(I).Left = Text1(0).Left
Text1(I).Top = Text1(I - 1).Top + Text1(I - 1).Height + 30
Text1(I).Visible = True
Next I
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.