当然你把连续的两个按扭都选择成分割线就出现两个连续的竖线。
不过该竖线不是你说的工具条前面的标志性竖线哦。
让LABEL里的文字竖排方法:
设置Label控件的Alignment为2
调整字号大小到显示单个字,或者收小Label控件的宽度(Width)
代码方法:
Private Function Vertical_Horizontal(ByVal nStr As String) As StringDim MyStr As String, i As Integer
Static Vert As Boolean
For i = 1 To Len(nStr)
If i < Len(nStr) Then
MyStr = MyStr + Mid$(nStr, i, 1) & vbCrLf
Else
MyStr = MyStr + Mid$(nStr, i, 1)
End If
Next
Vertical_Horizontal = MyStr
Vert = True
End Function
Private Sub Form_Load()
Label1.AutoSize = True
Label1.Caption = "VB如何让标签里的文字竖排"
Label1.Caption = Vertical_Horizontal(Label1.Caption)
End Sub
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)