VB.net动态建立label,怎么使label自动换行??
如题,动态建立了label,怎么让输入的文字在label里自动换行??谢谢
[最优解释]
Dim str As String = "a123456789b123456789c123456789fff"
Dim temp As String = ""
Dim BlockLen As Integer = 10
Do While Len(str) >= BlockLen
temp = temp & str.Substring(0, BlockLen) & vbCrLf
str = str.Substring(BlockLen)
Loop
temp = temp & str
Me.Label1.Text = temp
[其他解释]
设置Label的高度(Size属性),这样它就会自动换行了。
[其他解释]
谢谢UR_Not_Alone的代码,也谢谢caozhy斑竹的回答。用UR_Not_Alone的代码解决了。