一个很漂亮的三维字体
Dim posx, posy As Integer '文字的显示位置Dim txtwidth As Integer '文字轮廓宽度
Dim str As String '欲显示的文字
Private Sub Command1_Click() '显示凸起三维文字
Dim i As Integer
str = "显示凸起三维文字"
Me.Cls
Me.ForeColor = RGB(255, 255, 255)
For i = 1 To txtwidth
Me.CurrentX = posx - i
Me.CurrentY = posy - i
Me.Print str
Next i
Me.ForeColor = RGB(0, 0, 0)
For i = 1 To txtwidth
Me.CurrentX = posx + i
Me.CurrentY = posy + i
Me.Print str
Next i
Me.ForeColor = RGB(0, 0, 255)
Me.CurrentX = posx
Me.CurrentY = posy
Me.Print str
End Sub
Private Sub Command2_Click() '显示凹陷三维文字
Dim i As Integer
str = "显示凹陷三维文字"
Me.Cls
Me.ForeColor = RGB(0, 0, 0)
For i = 1 To txtwidth
Me.CurrentX = posx - i
Me.CurrentY = posy - i
Me.Print str
Next i
Me.ForeColor = RGB(255, 255, 255)
For i = 1 To txtwidth
Me.CurrentX = posx + i
Me.CurrentY = posy + i
Me.Print str
Next i
Me.ForeColor = RGB(0, 0, 255)
Me.CurrentX = posx
Me.CurrentY = posy
Me.Print str
End Sub
Private Sub Command3_Click() '显示阴影三维文字
str = "显示阴影三维文字"
Me.Cls
Me.ForeColor = RGB(100, 100, 100)
Me.CurrentX = posx + txtwidth
Me.CurrentY = posy + txtwidth
Me.Print str
Me.ForeColor = RGB(0, 0, 255)
Me.CurrentX = posx
Me.CurrentY = posy
Me.Print str
End Sub
Private Sub Command4_Click() '显示倾斜三维文字
Dim i As Integer
str = "显示倾斜三维文字"
Me.Cls
Me.ForeColor = RGB(100, 100, 100)
For i = 1 To txtwidth
Me.CurrentX = x + i
Me.CurrentY = y + i
Me.Print str
Next i
Me.ForeColor = RGB(0, 0, 255)
Me.CurrentX = posx
Me.CurrentY = posy
Me.Print str
End Sub
Private Sub Command5_Click()
End
End Sub
Private Sub Form_Load()
posx = 100
posy = 100
txtwidth = 50
Me.FontSize = 30
End Sub
三维文字.rar
(5.35 KB)