|
-
Jan 14th, 2005, 01:24 PM
#1
Thread Starter
Hyperactive Member
Rotating a label of command button on my VB form
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.
Using VS 6 Enterprise w/ SP5 & Windows 2000 Professional
-
Jan 14th, 2005, 01:46 PM
#2
New Member
Re: Rotating a label of command button on my VB form
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
-
Jan 14th, 2005, 02:39 PM
#3
Re: Rotating a label of command button on my VB form
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
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|