如何设置动态添加标签的文本对齐方式我在字符串变量中获取标签名称的地方在面板中动态添加一个标签
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 ??????
it does not show text align property
请帮忙