更新时间:2023-12-04 23:51:28
您需要将控件转换为标签:
You need to cast the control to a label:
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