www.pudn.com > shape.rar > shape.frm


VERSION 5.00 
Begin VB.Form Form1  
   Caption         =   "练习20" 
   ClientHeight    =   3360 
   ClientLeft      =   60 
   ClientTop       =   390 
   ClientWidth     =   4680 
   ControlBox      =   0   'False 
   LinkTopic       =   "Form1" 
   ScaleHeight     =   3360 
   ScaleWidth      =   4680 
   StartUpPosition =   3  '窗口缺省 
   Begin VB.HScrollBar HScroll1  
      Height          =   255 
      Left            =   2880 
      Max             =   6 
      Min             =   1 
      TabIndex        =   11 
      Top             =   2520 
      Value           =   1 
      Width           =   1455 
   End 
   Begin VB.ListBox Fill  
      Height          =   240 
      Left            =   2880 
      TabIndex        =   9 
      Top             =   2880 
      Width           =   1455 
   End 
   Begin VB.CommandButton Command7  
      Caption         =   "退出" 
      Height          =   255 
      Left            =   120 
      TabIndex        =   7 
      Top             =   2400 
      Width           =   1215 
   End 
   Begin VB.CommandButton Command6  
      Caption         =   "圆角正方形" 
      Height          =   255 
      Left            =   120 
      TabIndex        =   5 
      Top             =   2040 
      Width           =   1215 
   End 
   Begin VB.CommandButton Command5  
      Caption         =   "圆角矩形" 
      Height          =   255 
      Left            =   120 
      TabIndex        =   4 
      Top             =   1680 
      Width           =   1215 
   End 
   Begin VB.CommandButton Command4  
      Caption         =   "圆" 
      Height          =   255 
      Left            =   120 
      TabIndex        =   3 
      Top             =   1320 
      Width           =   1215 
   End 
   Begin VB.CommandButton Command3  
      Caption         =   "椭圆" 
      Height          =   255 
      Left            =   120 
      TabIndex        =   2 
      Top             =   960 
      Width           =   1215 
   End 
   Begin VB.CommandButton Command2  
      Caption         =   "正方形" 
      Height          =   255 
      Left            =   120 
      TabIndex        =   1 
      Top             =   600 
      Width           =   1215 
   End 
   Begin VB.CommandButton Command1  
      Caption         =   "矩形" 
      Height          =   255 
      Left            =   120 
      TabIndex        =   0 
      Top             =   240 
      Width           =   1215 
   End 
   Begin VB.Label Label3  
      Caption         =   "边框宽度" 
      Height          =   255 
      Left            =   1920 
      TabIndex        =   10 
      Top             =   2520 
      Width           =   735 
   End 
   Begin VB.Label Label2  
      Caption         =   "填充方式" 
      Height          =   255 
      Left            =   1920 
      TabIndex        =   8 
      Top             =   2880 
      Width           =   735 
   End 
   Begin VB.Label Label1  
      Caption         =   " " 
      Height          =   255 
      Left            =   1920 
      TabIndex        =   6 
      Top             =   2040 
      Width           =   2415 
   End 
   Begin VB.Shape Shape1  
      Height          =   1695 
      Left            =   1920 
      Top             =   240 
      Width           =   2415 
   End 
End 
Attribute VB_Name = "Form1" 
Attribute VB_GlobalNameSpace = False 
Attribute VB_Creatable = False 
Attribute VB_PredeclaredId = True 
Attribute VB_Exposed = False 
    Private Sub Command1_Click() 
         
        '  绘制矩形 
        Shape1.Shape = 0 
     
    End Sub 
     
    Private Sub Command2_Click() 
         
        '  绘制正方形 
        Shape1.Shape = 1 
     
    End Sub 
     
    Private Sub Command3_Click() 
         
        '  绘制椭圆 
        Shape1.Shape = 2 
     
    End Sub 
     
    Private Sub Command4_Click() 
         
        '  绘制圆 
        Shape1.Shape = 3 
     
    End Sub 
     
    Private Sub Command5_Click() 
         
        '  绘制圆角矩形 
        Shape1.Shape = 4 
     
    End Sub 
     
    Private Sub Command6_Click() 
     
        '  绘制圆角正方形 
        Shape1.Shape = 5 
     
    End Sub 
     
    Private Sub Command7_Click() 
         
        '  结束退出 
        End 
     
    End Sub 
     
    Private Sub Fill_Scroll() 
        Call Fill_Click 
    End Sub 
     
    Private Sub Form_Load() 
         
        '  初始话列表框选项 
        Fill.AddItem "0 实线" 
        Fill.AddItem "1 透明" 
        Fill.AddItem "2 水平直线" 
        Fill.AddItem "3 垂直直线" 
        Fill.AddItem "4 上斜对角线" 
        Fill.AddItem "5 下斜对角线" 
        Fill.AddItem "6 十字线" 
        Fill.AddItem "7 交叉对角线" 
         
    End Sub 
     
    Private Sub HScroll1_Change() 
     
        '  设置边框宽度 
        Shape1.BorderWidth = HScroll1.Value 
     
    End Sub 
     
    Private Sub Fill_Click() 
         
        If Fill.ListIndex <> "-1" Then 
            '  设置填充方式 
            Shape1.FillStyle = Fill.ListIndex 
        End If 
     
    End Sub