如何在vb label中写竖写的文字
2个回答
2013-12-18
展开全部
简单啊…你把那个标签框横向设置小点…竖向大一点就行
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
2013-12-18
展开全部
没有直接的方法,不过可以自己写代码实现
Private Function Vertical_Horizontal(ByVal nStr As String) As String
Dim MyStr As String, i As Integer
Static Vert As Boolean
If Vert = False Then
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
Else
For i = 1 To Len(nStr) Step 3
MyStr = MyStr + Mid$(nStr, i, 1)
Next
Vertical_Horizontal = MyStr
Vert = False
End If
End Function
Private Sub Command1_Click()
Label1.AutoSize = True
Label1.Caption = Vertical_Horizontal(Label1.Caption)
End Sub
窗体上有一个command1和label1,点击竖排,再点一次变回来,希望你能满意!
Private Function Vertical_Horizontal(ByVal nStr As String) As String
Dim MyStr As String, i As Integer
Static Vert As Boolean
If Vert = False Then
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
Else
For i = 1 To Len(nStr) Step 3
MyStr = MyStr + Mid$(nStr, i, 1)
Next
Vertical_Horizontal = MyStr
Vert = False
End If
End Function
Private Sub Command1_Click()
Label1.AutoSize = True
Label1.Caption = Vertical_Horizontal(Label1.Caption)
End Sub
窗体上有一个command1和label1,点击竖排,再点一次变回来,希望你能满意!
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询