Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
 
 
 
 
 
 
 
Old Pages
 
Old Index
Site Map
What's New
 
Books
How To
Tips & Tricks
Tutorials
Stories
Performance
Essays
Links
Q & A
New in VB6
Free Stuff
Pictures
 
 
 
TitleDynamically create controls at runtime using Load
Keywordscontrol, load, control array
CategoriesControls, Software Engineering
 
Create one control with index 0 at design time. Use the Load command to create others at run time. Be sure to set the control's Visible property to True because that property is always set to False for newly loaded controls.
 
Private Sub Command1_Click()
Dim index As Integer

    index = Text1.Count
    Load Text1(index)
    Text1(index).Top = Text1(index - 1).Top + _
        Text1(index - 1).Height + 30
    Text1(index).Text = "Text1(" & Format$(index) & ")"
    Text1(index).Visible = True
End Sub
 
 
Copyright © 1997-2003 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated