create automatically object component

i want to create automatically object button, label ,etc..
by programming vb6
what is command create it ?
konglokAsked:
Who is Participating?
 
alokanantConnect With a Mentor Commented:
for this u shall have to create an object first on the form. make its index property 0. to create another object from code, u can use the load command.

hth
alok.
0
 
corvanderlindenCommented:
The command you need is

Form1.Controls.Add "VB.CommandButton", "cmdObj1"
   With Form1!cmdObj1
      .Visible = True
      .Width = 2000
      .Caption = "Dynamic Button"
   End With
End Sub
0
 
corvanderlindenCommented:
If you are using VB6 you do not need a control array as suggested by alokanant
0
All Courses

From novice to tech pro — start learning today.