Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
C# Helper...
 
XML RSS Feed
Follow VBHelper on Twitter
 
 
 
MSDN Visual Basic Community
 
 
 
 
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-2010 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated