VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
Begin VB.Form Form1 
   Caption         =   "Form1"
   ClientHeight    =   3195
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   4680
   LinkTopic       =   "Form1"
   ScaleHeight     =   3195
   ScaleWidth      =   4680
   StartUpPosition =   3  '窗口缺省
   Begin VB.CommandButton Command7 
      Caption         =   "退出"
      Height          =   615
      Left            =   1560
      TabIndex        =   6
      Top             =   2475
      Width           =   1335
   End
   Begin VB.CommandButton Command6 
      Caption         =   "帮助"
      Height          =   615
      Left            =   2760
      TabIndex        =   5
      Top             =   1710
      Width           =   1335
   End
   Begin VB.CommandButton Command5 
      Caption         =   "打印机"
      Height          =   615
      Left            =   2760
      TabIndex        =   4
      Top             =   960
      Width           =   1335
   End
   Begin VB.CommandButton Command4 
      Caption         =   "字体"
      Height          =   615
      Left            =   2760
      TabIndex        =   3
      Top             =   240
      Width           =   1335
   End
   Begin VB.CommandButton Command3 
      Caption         =   "颜色"
      Height          =   615
      Left            =   240
      TabIndex        =   2
      Top             =   1680
      Width           =   1335
   End
   Begin VB.CommandButton Command2 
      Caption         =   "保存"
      Height          =   615
      Left            =   240
      TabIndex        =   1
      Top             =   960
      Width           =   1335
   End
   Begin VB.CommandButton Command1 
      Caption         =   "打开"
      Height          =   615
      Left            =   240
      TabIndex        =   0
      Top             =   240
      Width           =   1335
   End
   Begin MSComDlg.CommonDialog CommonDialog1 
      Left            =   1920
      Top             =   1080
      _ExtentX        =   847
      _ExtentY        =   847
      _Version        =   393216
   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()
    CommonDialog1.ShowOpen      '显示[打开]对话框
    MsgBox "打开文件" + CommonDialog1.FileName
End Sub

Private Sub Command2_Click()
    CommonDialog1.ShowSave      '显示[另存为]对话框
    MsgBox "保存文件为" + CommonDialog1.FileName
End Sub

Private Sub Command3_Click()
    CommonDialog1.ShowColor     '显示[颜色]对话框
    MsgBox "取得的颜色值为" + Str(CommonDialog1.Color)
End Sub

Private Sub Command4_Click()
    CommonDialog1.Flags = cdlCFBoth
    CommonDialog1.ShowFont              '显示[字体]对话框
    MsgBox "字体为" + CommonDialog1.FontName
End Sub

Private Sub Command5_Click()
   Dim KSPAGE, JSPAGE As Integer
   CommonDialog1.Min = 1                 '设置可打印的最小页号
   CommonDialog1.Max = 100               '设置可打印的最大页号
   CommonDialog1.ShowPrinter
   KSPAGE = CommonDialog1.FromPage  '从[打印]对话框中取出要打印的起始页号
   JSPAGE = CommonDialog1.ToPage   '从[打印]对话框中取出要打印的中止页号
   MsgBox "你打印了从 " + Str(KSPAGE) + "到" + Str(JSPAGE) + "页"
End Sub

Private Sub Command6_Click()
    CommonDialog1.HelpCommand = cdlHelpForceFile            '设置所需要的在线Help帮助类型
    CommonDialog1.HelpFile = "c:\windows\help\Update.hlp"   '指定Help文件的路径及文件名称
    CommonDialog1.ShowHelp                                  '显示[帮助]对话框
End Sub

Private Sub Command7_Click()
    End
End Sub

Private Sub Form_Load()
'初始化文件过滤属性
CommonDialog1.Filter = "JPG图像|*.jpg|BMP图像|*.bmp|全部文件|*.*"
End Sub
