DickiePotter
Programmer
Is there any way of making the caption text for a label display verticaly (up & down) in a form rather than accross it?
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
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