grrrrrrr ...
.... use:
'load
Private Sub Command1_Click( )
Dim cnt As Long
For cnt = 0 To 25
If cnt > 0 Then Load Text1(cnt)
With Text1(cnt)
.Move 300, 210 + (300 * cnt), 1700
.Visible = True
End With
Next
End Sub
'unload
Private Sub Command2_Click( )
Dim cnt As Long
For cnt = 25 To 0 Step -1
If cnt > 0 Then Unload Text1(cnt)
Next
End Sub
You can't unload the control added at design time, so it's important to test
to ensure the index > 0.
--
Randy Birch
MVP Visual Basic
http://www.mvps.org/vbnet/
Please respond only to the newsgroups so all can benefit.
"Randy Birch" <rg************ @mvps.org> wrote in message
news:N3******** **********@twis ter01.bloor.is. net.cable.roger s.com...
: Assuming you have one textbox on the form named Text1, with its index
: property set to 0 to create a control array:
:
:
: --
:
: Randy Birch
: MVP Visual Basic
:
http://www.mvps.org/vbnet/
: Please respond only to the newsgroups so all can benefit.
:
:
: "Tom Rathbun" <tj*******@comc ast.net> wrote in message
: news:jJ******** ************@co mcast.com...
: : This is probably simple but it has stumped me. I want to create objects
: at
: : runtime for example:
: : A program that would allow you to draw lines on a form. For each new
line
: I
: : would like to create a new line object in an array the same way you
would
: a
: : simple variable.
: :
: : if it was just a variable I could
: :
: : dim a(0) as single
: : .
: : (some code)
: : .
: : b=ubound(a)+1
: : redim preserve a(b) as single
: : .
: : (other code)
: :
: : Is it possible to do this with controls ... say 10 textboxs today 12
: : tomarrow etc.
: : right now I put a bunch in an array and hide the ones I don't need.
: :
: : Thanks
: : Tom
: :
: :
:
: