Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

vertical label caption text 1

Status
Not open for further replies.

DickiePotter

Programmer
Jan 8, 2001
30
GB
Is there any way of making the caption text for a label display verticaly (up & down) in a form rather than accross it?
 
Like the text in the start button of Windows 98 or WindowsMe ?

If yes i have a class for to do it ,send me a e-mail Eric De Decker
vbg.be@vbgroup.nl

Licence And Copy Protection AxtiveX
Source CodeBook for the programmer
 
Thank-You, Thank-You, Thank-You,
That is exactly what I needed,
E-mail under way...
Cheers...
:)
 
Eric,

If not a problem, I'd like to see this class.

Thanks. Jon Hawkins
jonscott8@yahoo.com

The World Is Headed For Mutiny,
When All We Want Is Unity. - Creed
 
Hi all!
Your can place a label with Label1.AutoSize = true and in Form_Load() write something like this:
Private Sub Form_Load()
Label1.Caption = "D" & vbCrLf & "D" & vbCrLf & "D" & vbCrLf & "D" & vbCrLf & "D" & vbCrLf & "D" & vbCrLf & "D"
End Sub

ast.
 
Nice thought ast,
I'll give it a try if the class dousn't do the job.
Cheers...
 
You don't need the class (and given that this thread was over 3 years old and that edderic last posted about 6 months ago it is unlikely that you'll get it). Try this code which was previously posted by me in thread222-537164, but included here with a minor bug fix (highlighted):
Code:
Option Explicit

Private Declare Function CreateFontIndirect Lib "gdi32" Alias "CreateFontIndirectA" (lpLogFont As LOGFONT) As Long

Private Const LF_FACESIZE = 32

Private Type LOGFONT
        lfHeight As Long
        lfWidth As Long
        lfEscapement As Long
        lfOrientation As Long
        lfWeight As Long
        lfItalic As Byte
        lfUnderline As Byte
        lfStrikeOut As Byte
        lfCharSet As Byte
        lfOutPrecision As Byte
        lfClipPrecision As Byte
        lfQuality As Byte
        lfPitchAndFamily As Byte
        lfFaceName As String * 32
End Type

Private Declare Function SelectObject Lib "gdi32" (ByVal hdc As Long, ByVal hObject As Long) As Long
Private Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long

Private Sub Command1_Click()
    Dim myFont As LOGFONT
    Dim hFont As Long
    Dim hOldFont As Long
    Dim OldGraphicsMode As Long

    myFont.lfFaceName = "Courier New" [COLOR=blue yellow][b]+ Chr(0)[/b][/color]
    myFont.lfHeight = -12 ' font size
    myFont.lfEscapement = -2700 ' Rotation in tenths of a degree
    myFont.lfOrientation = -2700 ' orientation in tenths of a degree. Frankly irrelvant unless graphics mode is GM_ADVANCED
    
    hFont = CreateFontIndirect(myFont)
    hOldFont = SelectObject(Form1.hdc, hFont)
    Form1.CurrentY = Form1.ScaleHeight / 2
    Form1.CurrentX = Form1.ScaleWidth / 2
    Form1.Print "Hello"
    
    ' Clean up
    SelectObject Form1.hdc, hOldFont
    DeleteObject hFont

End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top