请教老师,动态增加控件Label后,Label的宽度如何随字符的多少进行自动宽度,
现在得到的Label字符是
发起部门:市场
部 发起人:杨丽
想根据自动宽度Label显示为 发起部门:市场部 发起人:杨丽
Dim rt As Row = Tables("窗口2_Table1").Current
Dim st1 As String = rt("发起部门")
Dim st2 As String = rt("发起人员")
If rt("完成") = True Then
Dim lbl As WinForm.Label
lbl = e.Form.CreateControl("lable1", ControlTypeEnum.Label)
lbl.Text = "发起部门: " & st1 & " 发起人员: " & st2
lbl.Left = 200
lbl.Top = 100
e.Form.Controls("Panel1").AddControl(lbl)
'lbl.Width = "auto"
End If