VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Write 3D Text on Form/Picture

by Michael Frey (4 Submissions)
Category: Custom Controls/Forms/Menus
Compatability: Visual Basic 3.0
Difficulty: Beginner
Date Added: Wed 3rd February 2021
Rating: (3 Votes)

A small sub for 3D Text on a Form or Picture box. You can define the depth of the Text, the color, the font and the fontsize.

Assumes
To write on a picturebox replace "Form1" with "Picture1"

Rate Write 3D Text on Form/Picture

Private Sub Form_Load()
Text3D "Hallo", "Times New Roman", 26, 1500, 200, 100, 146, 16, 46
End Sub
Public Sub Text3D(Strng As String, Fnt As String, Font_size As Integer, XVal As Integer, YVal As Integer, Depth As Integer, Redcol As Integer, Greencol As Integer, Bluecol As Integer)
Form1.AutoRedraw = True
Form1.FontSize = Font_size
Form1.Font = Fnt
Form1.ForeColor = RGB(Redcol, Greencol, Bluecol)
ShadowY = YVal
ShadowX = XVal
For i = 0 To Depth
Form1.CurrentX = ShadowX - i
Form1.CurrentY = ShadowY + i
If i = Depth Then Form1.ForeColor = RGB(Redcol + 80, Greencol + 80, Bluecol + 80)
Form1.Print Strng
Next i
Form1.AutoRedraw = False
End Sub

Download this snippet    Add to My Saved Code

Write 3D Text on Form/Picture Comments

No comments have been posted about Write 3D Text on Form/Picture. Why not be the first to post a comment about Write 3D Text on Form/Picture.

Post your comment

Subject:
Message:
0/1000 characters