Bandit33x
12-11-2002, 01:14 PM
Can You put label and text boxes on an angle?
meteo
12-11-2002, 01:40 PM
EDIT***Never tried it with a textbox, but with a label it works great. I added a method of doing the textbox at the bottom of the post.
Well sure ya can. But I dunno if you can do it within VB. Simply open up a decent image editor *I use Paint Shop Pro* but any one will work. Type what you want in the font size, color, style, etc you want. Resize the "image". Then usually under Image or Edit or something, there is a "rotate image" feature. Rotate it how you want it and save it. Then you can simply just enter it as a picture, background, or whatever you want it as.
NOTE* Just make sure that the background of your "image" is either the same color as the background of your form or that the background of the "image" is transparent. Trust me, it will work and look nice if you do it right.
Good Luck!
EDIT*** For a textbox method
Make your form with a textbox with the text you want inside of it. Then hit "Print Screen" to copy your screen. Then, inside of your photo editor, just paste it in *Edit, Paste or CTRL+v* Then just select the textbox area you want and crop it. *Sorry, I'm assuming you have basic image editing skills. If not, let me know* Then, again, you can use the rotate feature to rotate it. Then save it, and enter it as a picture on your form. Of course, this can only be done if the text in your textbox is static and not supposed to change.
usetheforce2
12-11-2002, 04:19 PM
hey,
you can use the createfont and selectobject API to rotate text for a picture box very simply. here's quick little demo for ya...
put a picture box on a form (leave as picture1)
Private Declare Function CreateFont Lib "gdi32" Alias "CreateFontA" (ByVal H As Long, ByVal W As Long, ByVal E As Long, ByVal O As Long, ByVal W As Long, ByVal I As Long, ByVal u As Long, ByVal S As Long, ByVal C As Long, ByVal OP As Long, ByVal CP As Long, ByVal Q As Long, ByVal PAF As Long, ByVal F As String) As Long
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
Public Sub changeFont(esc As Long)
Dim New_Font_Hnd As Long
Dim Old_Font_Hnd As Long
' to change the angle the text just change the value of "esc"
New_Font_Hnd = CreateFont( _
16, _
16, _
esc, _
0, _
0, _
True, _
True, _
False, _
0, _
0, _
0, _
0, _
0, _
"timenewroman")
' now select the new font for the picture object
Old_Font_Hnd = SelectObject(Picture1.hdc, New_Font_Hnd)
With Picture1
.ScaleMode = vbPixels
.CurrentX = (.ScaleWidth / 2) - 100 - 16 * 3
.CurrentY = .ScaleHeight / 2
Form1.Picture1.Print "UseTheForce"
End With
'[clean up]
' now release new font and set back to old font
New_Font_Hnd = SelectObject(Picture1.hdc, Old_Font_Hnd)
' delete our new font object
DeleteObject New_Font_Hnd
End Sub
' ------------------ Call routine -----------------
Private Sub Form_Load()
Call changeFont(100) '<-- simply call routine like this
End Sub
enjoy
Regan