VB中怎样用星号画一个圆

来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/26 02:12:04
VB中怎样用星号画一个圆VB中怎样用星号画一个圆VB中怎样用星号画一个圆OptionExplicitPrivateSubCommand1_Click()DimCenterXAsSingle,Cente

VB中怎样用星号画一个圆
VB中怎样用星号画一个圆

VB中怎样用星号画一个圆
Option Explicit
Private Sub Command1_Click()
Dim CenterX As Single, CenterY As Single
Dim R As Integer, X As Single, Y As Single, i As Integer
Const pi = 3.1415926
Randomize
R = 2000
CenterX = Me.ScaleWidth / 2: CenterY = Me.ScaleHeight / 2
For i = 0 To 355 Step 5
X = CenterX + R * Cos(i * pi / 180)
Y = CenterY - R * Sin(i * pi / 180)
Me.ForeColor = QBColor(Int(Rnd() * 15))
Me.CurrentX = X: Me.CurrentY = Y
Me.Print "*"
Next
End Sub