home *** CD-ROM | disk | FTP | other *** search
- Type FileListBoxMasterForm From SampleMasterForm
- Dim Label1 As New Label
- Dim Label2 As New Label
- Dim Label3 As New Label
- Dim lblPath As New Label
- Dim Label5 As New Label
- Dim cboDrives As New FileComboBox
- Dim lstDirectory As New FileListBox
- Dim lstFiles As New FileListBox
-
- ' METHODS for object: FileListBoxMasterForm
- Sub cboDrives_Click()
- ' Go to the selected drive/directory
- DisplayDir(cboDrives.SelPath)
- End Sub
-
- Sub DisplayDir(ByVal dir As String)
- ' Setting list directory path has the side effect of
- ' resetting the lstDirectory.SelPath to ""
- ' Since DisplayDir is called sending this value, we need
- ' to use ByVal to explicitly copy the SelPath value.
- lstDirectory.Path = dir
- lstFiles.Path = dir
- cboDrives.SelectDrive(lstDirectory.Path)
- lblPath.Text = lstDirectory.Path
- End Sub
-
- Sub lstDirectory_DblClick()
- ' Go to the selected directory
- DisplayDir(lstDirectory.SelPath)
- End Sub
-
- Sub ResetApplication_Click
- ' Preset the height of the combo drive box
- cboDrives.Height = 1500
-
- ' Preset the filter for the file list
- lstFiles.Filter = "*.*"
-
- ' Go to the current working directory.
- DisplayDir(Directory.CurrentDir)
- End Sub
-
- End Type
-
- Begin Code
- ' Reconstruction commands for object: FileListBoxMasterForm
- '
- With FileListBoxMasterForm
- .Caption := "File ListBox Demonstration"
- .Move(4500, 1725, 6945, 4380)
- .SampleDir := "C:\ENVELOP\bootcamp\basic\filelist\"
- .SampleName := "FILELIST"
- With .Label1
- .Caption := "Drives:"
- .ForeColor := 13107200
- .ZOrder := 1
- .Move(450, 150, 900, 300)
- End With 'FileListBoxMasterForm.Label1
- With .Label2
- .Caption := "Directories:"
- .ForeColor := 13107200
- .ZOrder := 2
- .Move(2250, 150, 1200, 300)
- End With 'FileListBoxMasterForm.Label2
- With .Label3
- .Caption := "Files:"
- .ForeColor := 13107200
- .ZOrder := 3
- .Move(4650, 150, 600, 300)
- End With 'FileListBoxMasterForm.Label3
- With .lblPath
- .ZOrder := 4
- .Move(600, 3150, 6000, 300)
- End With 'FileListBoxMasterForm.lblPath
- With .Label5
- .Caption := "Path:"
- .ForeColor := 13107200
- .ZOrder := 5
- .Move(300, 2700, 1800, 300)
- End With 'FileListBoxMasterForm.Label5
- With .cboDrives
- .ZOrder := 6
- .Move(450, 600, 1500, 360)
- .ShowDrives := True
- .ShowFiles := False
- End With 'FileListBoxMasterForm.cboDrives
- With .lstDirectory
- .ZOrder := 7
- .Move(2220, 570, 2115, 1950)
- .Path := "C:\envelop\bootcamp\basic\filelist"
- .ShowDirs := True
- .ShowFiles := False
- End With 'FileListBoxMasterForm.lstDirectory
- With .lstFiles
- .ZOrder := 8
- .Move(4620, 570, 1980, 1950)
- .Path := "C:\envelop\bootcamp\basic\filelist"
- .Filter := "*.*"
- End With 'FileListBoxMasterForm.lstFiles
- With .helpfile
- .FileName := "C:\ENVELOP\bootcamp\basic\filelist\FILELIST.hlp"
- End With 'FileListBoxMasterForm.helpfile
- End With 'FileListBoxMasterForm
- End Code
-