Visual Basic 6.0 offers plenty of tools for displaying regular text, but what if you want special effects? This article shows you how to display 3-D text in your program. The Windows API's TextOut function displays text on the screen. The declaration is as follows (place this in a module in your program): Code: Public Declare Function TextOut Lib "gdi32" Alias _ "TextOutA" (ByVal hdc As Long, ByVal x As Long, _ ByVal y As Long, ByVal lpString As String, ByVal _ nCount As Long) As Long Here are the arguments: hdc is the device context of the destination. x and y are the coordinates of the location to display the text. lpString is the text to display. nCount is the length of the string. A device context is the way Windows represents certain display objects. In Visual Basic, only forms, Picture Box controls, and the printers have a device context, which means this technique is limited to displaying 3-D text on those objects. The technique used here to display 3-D text is to output the string repeatedly at slightly different, overlapping locations. By varying the colour of the text with each iteration, you obtain a 3-D effect. Here's an example: Code: Private Sub Command1_Click() Dim i As Integer Dim s As String With Form1 s = "Text to display" For i = 0 To 127 .Font.Name = "Times New Roman" .Font.Size = 36 .ForeColor = RGB(i * 2, i * 2, i * 2) TextOut .hdc, i / 15, i / 15, s, Len(s) Next End With End Sub You can see that the text is output 128 times. Each time, the position shifts down slightly and to the right, and the colour changes. In the entire process, the colour changes from black or RGB(0, 0, 0) to essentially white or RGB(254, 254, 254). You could get a different but equally effective result by varying the colour from white to black by changing this single line of code: Code: .ForeColor = RGB(256 - i * 2, 256 - i * 2, 256 - i * 2) This code varies the colour from blue to red: Code: .ForeColor = RGB(i * 2, 0, 256 - i * 2) There are lots of attractive effects available with this technique. Its recommended that you experiment until you get just what you want.