Is it possible to rotate a control on my VBform from left to right to vertical? For instance I want my command button or label to be rotated vertical rather than the standard horizontal.
Thanks.
Printable View
Is it possible to rotate a control on my VBform from left to right to vertical? For instance I want my command button or label to be rotated vertical rather than the standard horizontal.
Thanks.
I don't think there is a way to rotate.
But if you want the text to be vertical top to bottom then you could use:
VB Code:
Command1.Caption = "C" & vbCr & "o" & vbCr & "m" & vbCr & "m" & vbCr _ & "a" & vbCr & "n" & vbCr & "d" & vbCr & "1" & vbCr
You could automate an input string into a for-next to add the CRs after each character.
Its all down to appearance, as the vertical button will be bigger than the regular horizontal. Try it and see.
Mike
Bare in the mind that the control needs to be stretched vertically enough so whatever the text is will be displayed in its entirety, or, you could programmatically adjust the control to accept the vertical text.VB Code:
Private Function ShowVertical(ByVal sMyString As String) As String Dim sTheString As String Dim i As Long For i = 1 To Len(sMyString) If i < Len(sMyString) Then sTheString = sTheString + Mid$(sMyString, i, 1) & vbCrLf Else sTheString = sTheString + Mid$(sMyString, i, 1) End If Next ShowVertical = sTheString End Function Private Sub Form_Load() Label1.Caption = ShowVertical(Label1.Caption) 'and/or Command1.Caption = ShowVertical(Command1.Caption) End Sub