Dim x As Single, y As Single, r As Integer
Private Sub HScroll1_change()
HScroll1.Min = 0
HScroll1.Max = 750
r = HScroll1.Value
End Sub
Private Sub Command2_Click()
Dim m As Integer
m = Text1.Text
p = 3.14
For j = 1 To m
x = 1750 + 750 * Cos((2 * p * j) / m)
y = 2000 + 750 * Sin((2 * p * j) / m)
Picture1.Circle (x, y), r
Next j
End Sub
Private Sub Picture1_Click()
Picture1.Cls
End Sub
Private Sub Command1_Click()
Dim n As Integer, i As Integer
p = 3.14
n = InputBox("请输入等分圆的份数")
For i = 1 To n
x = 1750 + 750 * Cos((2 * p * i) / n)
y = 2000 + 750 * Sin((2 * p * i) / n)
Picture1.Circle (x, y), 750
Next i
End Sub
Private Sub Form_load()
Cls
Form1.ScaleLeft = 0.5
Form1.ScaleHeight = 2
Form1.ScaleWidth = 3.5
Cls
Form1.Circle (2, 1), 0.4, , , , 2.5
Form1.Circle (2, 1), 0.2, , , , 2
End Sub