VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "Comdlg32.ocx"
Begin VB.Form frmCommon 
   Caption         =   "Form1"
   ClientHeight    =   3195
   ClientLeft      =   165
   ClientTop       =   855
   ClientWidth     =   4680
   LinkTopic       =   "Form1"
   ScaleHeight     =   3195
   ScaleWidth      =   4680
   StartUpPosition =   3  'Windows Default
   Begin MSComDlg.CommonDialog CommonDialog1 
      Left            =   2160
      Top             =   1320
      _ExtentX        =   847
      _ExtentY        =   847
      _Version        =   393216
      CancelError     =   -1  'True
   End
   Begin VB.Menu mnuFile 
      Caption         =   "Файл"
      Begin VB.Menu mnuColor 
         Caption         =   "Цвет"
      End
      Begin VB.Menu mnuOpen 
         Caption         =   "Открытие файла"
      End
      Begin VB.Menu mnusep1 
         Caption         =   "-"
      End
      Begin VB.Menu mnuExit 
         Caption         =   "выход"
      End
   End
End
Attribute VB_Name = "frmCommon"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub mnuColor_Click()
On Error GoTo ColorError
CommonDialog1.Action = 3
frmCommon.BackColor = CommonDialog1.Color
Exit Sub
ColorError:
MsgBox "Вы закрыли диалог Цвет кнопкой Отмена"
Exit Sub
End Sub

Private Sub mnuExit_Click()
End
End Sub

Private Sub mnuOpen_Click()
Dim filter As String
On Error GoTo OpenError
filter = "Все файлы(*.*)|"
filter = filter + "Текстовые файлы(*.txt)|*.txt"
CommonDialog1.filter = filter
CommonDialog1.FilterIndex = 2
CommonDialog1.Action = 1
MsgBox "Вы выбрали: " + CommonDialog1.FileName
Exit Sub
OpenError:
MsgBox "Вы закрыли диалог Open кнопкой Отмена"
Exit Sub

End Sub
