|
|
Title | Dynamically create controls at runtime using Load |
Keywords | control, load, control array |
Categories | Controls, 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
|
|
|
|
|
|