VERSION 5.00
Begin VB.Form Form1 
   BackColor       =   &H00FFFFFF&
   Caption         =   "VB6 例10-12  Circle方法绘制艺术图案"
   ClientHeight    =   3150
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   5280
   LinkTopic       =   "Form1"
   ScaleHeight     =   3150
   ScaleWidth      =   5280
   StartUpPosition =   3  '窗口缺省
   Begin VB.TextBox Text1 
      Height          =   315
      Left            =   4500
      TabIndex        =   0
      Text            =   "10"
      Top             =   2580
      Width           =   675
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Private Sub Form_Click()
    Dim r, x, y, x0, y0, pi As Single
    Cls
    n = Val(Text1)
    If n <= 0 Then n = 10
    r = Form1.ScaleHeight / 4
    x0 = Form1.ScaleWidth / 2
    y0 = Form1.ScaleHeight / 2
    pi = 3.1415926
    st = pi / n                            ' 等分圆周为20份
    For i = 0 To 2 * pi Step st             ' 循环绘制圆
        x = r * Cos(i) + x0
        y = r * Sin(i) + y0
        Circle (x, y), r * 0.9
    Next i
End Sub

