home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Begin VB.Form FileDemoForm
- Caption = "File Controls Demo"
- ClientHeight = 5790
- ClientLeft = 60
- ClientTop = 345
- ClientWidth = 6690
- LinkTopic = "Form1"
- ScaleHeight = 5790
- ScaleWidth = 6690
- StartUpPosition = 3 'Windows Default
- Begin VB.CommandButton Command4
- Caption = "List All Files"
- BeginProperty Font
- Name = "Comic Sans MS"
- Size = 9.75
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 675
- Left = 5010
- TabIndex = 7
- Top = 2355
- Width = 1545
- End
- Begin VB.CommandButton Command3
- Caption = "List All Parent Folders"
- BeginProperty Font
- Name = "Comic Sans MS"
- Size = 9.75
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 675
- Left = 3380
- TabIndex = 6
- Top = 2355
- Width = 1545
- End
- Begin VB.CommandButton Command2
- Caption = "List All Subfolders"
- BeginProperty Font
- Name = "Comic Sans MS"
- Size = 9.75
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 675
- Left = 1750
- TabIndex = 5
- Top = 2355
- Width = 1545
- End
- Begin VB.ListBox List1
- BeginProperty Font
- Name = "Comic Sans MS"
- Size = 9.75
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 2490
- Left = 135
- TabIndex = 4
- Top = 3135
- Width = 6420
- End
- Begin VB.CommandButton Command1
- Caption = "List All Drives"
- BeginProperty Font
- Name = "Comic Sans MS"
- Size = 9.75
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 675
- Left = 120
- TabIndex = 3
- Top = 2355
- Width = 1545
- End
- Begin VB.FileListBox File1
- BeginProperty Font
- Name = "Comic Sans MS"
- Size = 9.75
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 1980
- Left = 3495
- TabIndex = 2
- Top = 150
- Width = 3060
- End
- Begin VB.DirListBox Dir1
- BeginProperty Font
- Name = "Comic Sans MS"
- Size = 9.75
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 1290
- Left = 120
- TabIndex = 1
- Top = 840
- Width = 3180
- End
- Begin VB.DriveListBox Drive1
- BeginProperty Font
- Name = "Comic Sans MS"
- Size = 9.75
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 390
- Left = 120
- TabIndex = 0
- Top = 150
- Width = 3180
- End
- Attribute VB_Name = "FileDemoForm"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Private Sub Command1_Click()
- ' Scan the contents of the DriveListBox control
- List1.Clear
- List1.AddItem "LIST OF DRIVES"
- For i = 0 To Drive1.ListCount - 1
- List1.AddItem Drive1.List(i)
- End Sub
- Private Sub Command2_Click()
- ' Scan the contents of the DirListBox control
- List1.Clear
- List1.AddItem "LIST OF SUBFOLDERS"
- For i = 0 To Dir1.ListCount - 1
- List1.AddItem Dir1.List(i)
- End Sub
- Private Sub Command3_Click()
- List1.Clear
- List1.AddItem "LIST OF PARENT FOLDERS"
- pDepth = -1
- While Dir1.List(pDepth) <> ""
- List1.AddItem Dir1.List(pDepth)
- pDepth = pDepth - 1
- List1.AddItem "The current folder is nested " & -pDepth + 1 & " folders deep"
- End Sub
- Private Sub Command4_Click()
- ' Scan the contents of the FileListBox control
- List1.Clear
- List1.AddItem "LIST OF FILES"
- For i = 0 To File1.ListCount - 1
- List1.AddItem File1.List(i)
- End Sub
-