v6b03-13.frm

来自「通过使用控件数组来实现画不同的图形,希望能喜欢」· FRM 代码 · 共 121 行

FRM
121
字号
VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "控件数组"
   ClientHeight    =   2625
   ClientLeft      =   1095
   ClientTop       =   1515
   ClientWidth     =   3930
   LinkTopic       =   "Form1"
   PaletteMode     =   1  'UseZOrder
   ScaleHeight     =   2625
   ScaleWidth      =   3930
   Begin VB.PictureBox picShape 
      Height          =   1575
      Left            =   1440
      ScaleHeight     =   1515
      ScaleWidth      =   1755
      TabIndex        =   4
      Top             =   600
      Width           =   1815
   End
   Begin VB.CommandButton cmdShape 
      Caption         =   "结束"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Index           =   3
      Left            =   480
      TabIndex        =   3
      Top             =   2040
      Width           =   855
   End
   Begin VB.CommandButton cmdShape 
      Caption         =   "圆"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Index           =   2
      Left            =   480
      TabIndex        =   2
      Top             =   1440
      Width           =   855
   End
   Begin VB.CommandButton cmdShape 
      Caption         =   "矩形"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Index           =   1
      Left            =   480
      TabIndex        =   1
      Top             =   840
      Width           =   855
   End
   Begin VB.CommandButton cmdShape 
      Caption         =   "直线"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Index           =   0
      Left            =   480
      TabIndex        =   0
      Top             =   240
      Width           =   855
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdShape_Click(Index As Integer)
  picShape.Cls
  picShape.FillStyle = 5
  Select Case Index
    Case 0
      picShape.Print "画直线"
      picShape.Line (2, 2)-(7, 7)
    Case 1
      picShape.Print "画矩形"
      picShape.Line (2, 2)-(7, 7), , BF
    Case 2
      picShape.Print "画圆"
      picShape.Circle (4.5, 4.5), 3.5, , , , 0.4
    Case Else
      End
    End Select
End Sub

Private Sub Form_Load()
    picShape.Scale (0, 0)-(10, 10)   '设置坐标系
End Sub

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?