VERSION 5.00
Begin VB.Form Form1 
   BackColor       =   &H00FFFFFF&
   Caption         =   "VB6  例10-7 Shape控件数组"
   ClientHeight    =   2160
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   4050
   LinkTopic       =   "Form1"
   ScaleHeight     =   2160
   ScaleWidth      =   4050
   StartUpPosition =   3  '窗口缺省
   Begin VB.Shape Shape1 
      BorderColor     =   &H00C00000&
      BorderWidth     =   5
      Height          =   795
      Index           =   0
      Left            =   660
      Shape           =   3  'Circle
      Top             =   420
      Width           =   915
   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_Load()
    Dim mtop As Integer, mleft As Integer, i As Integer, j As Integer, k As Integer
    Dim mc As Integer
    mtop = Shape1(0).Top
    mleft = Shape1(0).Left + Shape1(0).Width
    For i = 1 To 2
        For j = 1 To 2
            k = (i - 1) * 2 + j
            Load Shape1(k)
            Select Case k        ' 设置颜色
            Case 1
            mc = 0
            Case 2
            mc = 12
            Case 3
            mc = 14
            Case 4
            mc = 11
            End Select
            Shape1(k).BorderColor = QBColor(mc)
            Shape1(k).Visible = True
            Shape1(k).Top = mtop
            Shape1(k).Left = mleft
            mleft = mleft + Shape1(0).Width         ' 下一列位置
        Next j
        mtop = mtop + Shape1(0).Width / 2           ' 下一行位置
        mleft = Shape1(0).Left + Shape1(0).Width / 2
    Next i
End Sub
