Dim instance As New Label Dim stringVariable As String
instance.Location = New Point(15, 15) instance.Size = New Size(60, 30) instance.BorderStyle = BorderStyle.FixedSingle instance.AutoSize = False instance.Text = "LABEL1" Me.Panel1.Controls.Add(instance)
for each c as control in Panel1.Controls stringVariable=c.name next
Me.Panel1.Controls(stringVariable).textalign ??????
For Each c As Control In Panel1.Controls stringVariable = c.name Dim l As Label = TryCast(c, Label) If l IsNot Nothing Then l.TextAlign = ContentAlignment.MiddleCenter End If Next
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)