Sarfaraz,
If you mean adding controls dynamically to a form, you do it in the code:
Create a control object at the module level (before the Windows Form
Designer generated code):
Private MyLabel as Label
Then, after InitializeComponent, or in the Load event, set the position and
visibility of the control and add it to the Controls collection of the Form:
With MyLabel
.Top = 40
.Left = 40
.Visible = True
End With
Me.Controls.Add(MyLabel)
That's it. Now, to have an ARRAY of controls, create an array at the module
level:
Private MyLabels as Label()
Then in the Load event, execute similar code for each of the objects in the
array:
Dim i as Integer
ReDim MyLabels(9)
For i = 0 To 9
MyLabels(i) = New Label
With MyLabels(i)
.Top = (i * 40) + 40
.Left = 40
.Visible = True
End With
Me.Controls.Add(MyLabels(i))
Next i
In order to change your control later in the form, just call your
module-level object:
MyLabels(5).Text = "Some New Text"
Hope this helps.