Hi i want to make labels dynamically. The method i designed is below
now i want to give it a call like this
labelarea(312, 344, 64, 40, " text here ", label1)
for doing this i have to also write this line of code
Dim label1 As New Label()
which mean i have to know exactly the number of labels i want that is the problem i dont know the number is there any solution or can i make any are of variables with type label
any idea people
Public Sub labelarea(ByVal x As Integer, ByVal y As Integer, ByVal width As Integer, ByVal height As Integer, ByVal textValue As String, ByVal labels As Label)
labels.Location = New System.Drawing.Point(x, y)
labels.Name = "Label1"
labels.Size = New System.Drawing.Size(width, height)
labels.BorderStyle = BorderStyle.FixedSingle
labels.Text = textValue
labels.TextAlign = ContentAlignment.MiddleCenter
Me.Controls.Add(labels)
End Sub
now i want to give it a call like this
labelarea(312, 344, 64, 40, " text here ", label1)
for doing this i have to also write this line of code
Dim label1 As New Label()
which mean i have to know exactly the number of labels i want that is the problem i dont know the number is there any solution or can i make any are of variables with type label
any idea people
Public Sub labelarea(ByVal x As Integer, ByVal y As Integer, ByVal width As Integer, ByVal height As Integer, ByVal textValue As String, ByVal labels As Label)
labels.Location = New System.Drawing.Point(x, y)
labels.Name = "Label1"
labels.Size = New System.Drawing.Size(width, height)
labels.BorderStyle = BorderStyle.FixedSingle
labels.Text = textValue
labels.TextAlign = ContentAlignment.MiddleCenter
Me.Controls.Add(labels)
End Sub