you would of thought there would be a property for this, but i cant see it!!!
you can work around it by setting wordwrap to true and setting width really small (but thats not very neat looking)
or you could write a char at a time followed by vbCRLF
for i = 1 to len(yourstring)
str=mid(yourstring,i,1)
label1.caption=label1.caption & str & vbcrlf
next i
again not very nice!!
if there is an easyer way i would love to hear it
good luck
If somethings hard to do, its not worth doing - Homer Simpson
------------------------------------------------------------------------
A General Guide To Excel in VB FAQ222-3383
File Formats Galore @
That is what I was trying, but the captions that I want do not look very nice. I stopped playing with it last night, If I get a chance to play some more today I will.
Instead of using a label caption you could use a picture box or an image box - make a nice bmp (or whatever) save it and add it to your form through picturebox or image.
Actually the way that you came up is the easiest way. Too bad I redisigned my form and I am not going to use the vertical label. But it is good to know for the future. Thanks
if you set autosize and wordwrap to true and type with spaces, it doesnt actualy cause a word wrap!!
it just autosizes horizontally with spaced out letters!!
If somethings hard to do, its not worth doing - Homer Simpson
------------------------------------------------------------------------
A General Guide To Excel in VB FAQ222-3383
File Formats Galore @
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 = "Ariel"
myFont.lfHeight = -24 ' 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
If somethings hard to do, its not worth doing - Homer Simpson
------------------------------------------------------------------------
A General Guide To Excel in VB FAQ222-3383
File Formats Galore @
Dim a As Integer
Dim temp As String
ReDim s(Len(Label1)) As String
For a = 0 To Len(Label1) - 1
s(a) = Mid$(Label1, a + 1, 1) & vbNewLine
temp = temp & s(a)
Next
Label1 = temp
I'm new to VB but a pro in Delphi and have used the LOGFONT to print rotated text and the rules are the same. The key is that only TrueType fonts can be displayed in this fashion. Probably if it didn't work, then change the font to a TrueType font and it will. You can tell windows to substitute a TrueType font all the time by setting the lfOutPrecision element to OUT_TT_ONLY_PRECIS.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.