VB中怎样用星号画一个圆
2个回答
展开全部
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
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询