VERSION 5.00
Begin VB.Form frmSize 
   Caption         =   "Размер файла"
   ClientHeight    =   4110
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   4680
   LinkTopic       =   "Form1"
   ScaleHeight     =   4110
   ScaleWidth      =   4680
   StartUpPosition =   3  'Windows Default
   Begin VB.CommandButton cmdCancel 
      Caption         =   "Cancel"
      Height          =   375
      Left            =   2520
      TabIndex        =   11
      Top             =   3600
      Width           =   2055
   End
   Begin VB.CommandButton cmdOk 
      Caption         =   "Ok"
      Height          =   375
      Left            =   240
      TabIndex        =   10
      Top             =   3600
      Width           =   1935
   End
   Begin VB.DriveListBox drvDrive 
      Height          =   315
      Left            =   2520
      TabIndex        =   9
      Top             =   3120
      Width           =   2055
   End
   Begin VB.DirListBox DirDirectory 
      Height          =   1665
      Left            =   2520
      TabIndex        =   7
      Top             =   960
      Width           =   1935
   End
   Begin VB.ComboBox CboFileType 
      Height          =   315
      Left            =   120
      Style           =   2  'Dropdown List
      TabIndex        =   4
      Top             =   3120
      Width           =   2295
   End
   Begin VB.FileListBox filfiles 
      Height          =   1650
      Left            =   120
      TabIndex        =   2
      Top             =   960
      Width           =   2175
   End
   Begin VB.TextBox txtFileName 
      Height          =   375
      Left            =   120
      TabIndex        =   1
      Top             =   480
      Width           =   2175
   End
   Begin VB.Label lblDrive 
      Caption         =   "Диск:"
      Height          =   255
      Left            =   2520
      TabIndex        =   8
      Top             =   2640
      Width           =   2055
   End
   Begin VB.Label lblDirName 
      BorderStyle     =   1  'Fixed Single
      Height          =   375
      Left            =   2520
      TabIndex        =   6
      Top             =   480
      Width           =   1905
   End
   Begin VB.Label lblDirectories 
      Caption         =   "каталоги"
      Height          =   255
      Left            =   2640
      TabIndex        =   5
      Top             =   0
      Width           =   1215
   End
   Begin VB.Label lblTypeFile 
      Caption         =   "Тип файла:"
      Height          =   255
      Left            =   120
      TabIndex        =   3
      Top             =   2640
      Width           =   2055
   End
   Begin VB.Label lblFileName 
      Caption         =   "Имя файла:"
      Height          =   375
      Left            =   120
      TabIndex        =   0
      Top             =   120
      Width           =   2055
   End
End
Attribute VB_Name = "frmSize"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False


Private Sub CboFileType_Click()
Select Case CboFileType.ListIndex
Case 0
filfiles.Pattern = "*.*"

Case 1
filfiles.Pattern = "*.txt"

Case 2
filfiles.Pattern = "*.Doc*"

End Select

End Sub

Private Sub cmdCancel_Click()
End
End Sub

Private Sub cmdOk_Click()
Dim PathAndName As String
Dim FileSize As String
Dim path As String

If txtFileName.Text = "" Then
MsgBox "Файл не выбран!"
Exit Sub
End If

If Right(filfiles.path, 1) <> "\" Then
path = filfiles.path + "\"
Else
path = filfiles.path
End If

If txtFileName.Text = filfiles.FileName Then
PathAndName = path + filfiles.FileName
Else
PathAndName = txtFilName.Text
End If
On Error GoTo FileLEnError
FileSize = Str(FileLen(PathAndName))
MsgBox "Размер файла " + PathAndName + ":" + FileSize + "bites"
Exit Sub

FileLEnError:
MsgBox " Не могу определит размер файла" + PathAndName
Exit Sub
End Sub


Private Sub DirDirectory_Change()
filfiles.path = DirDirectory.path
lblDirName.Caption = DirDirectory.path
End Sub

Private Sub drvDrive_Change()
On Error GoTo DriveError
DirDirectory.path = drvDrive.Drive
Exit Sub

DriveError:
MsgBox "Ошибка выбора устройства", vbExclamation, "Ошибка"
drvDrive = dirdrive.path
Exit Sub
End Sub

Private Sub filfiles_Click()
txtFileName.Text = filfiles.FileName

End Sub

Private Sub filfiles_DblClick()
txtFileName.Text = filfiles.FileName
cmdOk_Click
End Sub

Private Sub Form_Load()
CboFileType.AddItem "Все файлы(*.*) "
CboFileType.AddItem "Текстовые файлы(*.txt) "
CboFileType.AddItem "Документы Word(*.doc)"
CboFileType.ListIndex = 0
lblDirName.Caption = DirDirectory.path

End Sub

Private Sub lblDirName_Click()

End Sub

Private Sub txtFileName_Change()

End Sub
