Visual Basic Tip: 10/16/95


How to Draw 3-D Text.
The code listed below can be used to draw 3-D text on a 
form.  When used on a form where AutoRedraw = False, place
this code in the Form_Paint subroutine.  The ScaleMode and
FontSize lines could be set in Form_Load or at design time,
if you are not going to change the values during run time.
Note: Scalemode, FontSize, ForeColor are altered.  Save and
restore these values if you wish! 

The combination of colors in this example looks best on a
form with the BackColor set to light grey.  Experiment with
other colors in the routine for a different look.

' Draw 3-D text on a form.
' Note: Scalemode, FontSize, ForeColor are altered by
'       this routine.  Save and restore these values
'       if you wish!

 ScaleMode = 3                         'pixel
 FontSize = 24                         'set font to 24 pts
 ForeColor = &H808080                  'dark grey
 thetop% = 15                          'top of lettering
 theleft% = 5                          'left of lettering

 For j% = 0 To 7
   CurrentX = theleft% + j%
   CurrentY = thetop% + j%
   If j% = 7 Then ForeColor = &HFFFF00  'lt blue
   Print "This is 3-D Look Text"
 Next
Return to Phil's Web Page

Created by: Philip