home *** CD-ROM | disk | FTP | other *** search
/ Mastering Visual Basic 6 / mastvb6.iso / ch_code / ch05 / filedemo / filedemo.frm (.txt) next >
Encoding:
Visual Basic Form  |  1996-06-05  |  5.6 KB  |  179 lines

  1. VERSION 5.00
  2. Begin VB.Form FileDemoForm 
  3.    Caption         =   "File Controls Demo"
  4.    ClientHeight    =   5790
  5.    ClientLeft      =   60
  6.    ClientTop       =   345
  7.    ClientWidth     =   6690
  8.    LinkTopic       =   "Form1"
  9.    ScaleHeight     =   5790
  10.    ScaleWidth      =   6690
  11.    StartUpPosition =   3  'Windows Default
  12.    Begin VB.CommandButton Command4 
  13.       Caption         =   "List All Files"
  14.       BeginProperty Font 
  15.          Name            =   "Comic Sans MS"
  16.          Size            =   9.75
  17.          Charset         =   0
  18.          Weight          =   400
  19.          Underline       =   0   'False
  20.          Italic          =   0   'False
  21.          Strikethrough   =   0   'False
  22.       EndProperty
  23.       Height          =   675
  24.       Left            =   5010
  25.       TabIndex        =   7
  26.       Top             =   2355
  27.       Width           =   1545
  28.    End
  29.    Begin VB.CommandButton Command3 
  30.       Caption         =   "List All Parent Folders"
  31.       BeginProperty Font 
  32.          Name            =   "Comic Sans MS"
  33.          Size            =   9.75
  34.          Charset         =   0
  35.          Weight          =   400
  36.          Underline       =   0   'False
  37.          Italic          =   0   'False
  38.          Strikethrough   =   0   'False
  39.       EndProperty
  40.       Height          =   675
  41.       Left            =   3380
  42.       TabIndex        =   6
  43.       Top             =   2355
  44.       Width           =   1545
  45.    End
  46.    Begin VB.CommandButton Command2 
  47.       Caption         =   "List All Subfolders"
  48.       BeginProperty Font 
  49.          Name            =   "Comic Sans MS"
  50.          Size            =   9.75
  51.          Charset         =   0
  52.          Weight          =   400
  53.          Underline       =   0   'False
  54.          Italic          =   0   'False
  55.          Strikethrough   =   0   'False
  56.       EndProperty
  57.       Height          =   675
  58.       Left            =   1750
  59.       TabIndex        =   5
  60.       Top             =   2355
  61.       Width           =   1545
  62.    End
  63.    Begin VB.ListBox List1 
  64.       BeginProperty Font 
  65.          Name            =   "Comic Sans MS"
  66.          Size            =   9.75
  67.          Charset         =   0
  68.          Weight          =   400
  69.          Underline       =   0   'False
  70.          Italic          =   0   'False
  71.          Strikethrough   =   0   'False
  72.       EndProperty
  73.       Height          =   2490
  74.       Left            =   135
  75.       TabIndex        =   4
  76.       Top             =   3135
  77.       Width           =   6420
  78.    End
  79.    Begin VB.CommandButton Command1 
  80.       Caption         =   "List All Drives"
  81.       BeginProperty Font 
  82.          Name            =   "Comic Sans MS"
  83.          Size            =   9.75
  84.          Charset         =   0
  85.          Weight          =   400
  86.          Underline       =   0   'False
  87.          Italic          =   0   'False
  88.          Strikethrough   =   0   'False
  89.       EndProperty
  90.       Height          =   675
  91.       Left            =   120
  92.       TabIndex        =   3
  93.       Top             =   2355
  94.       Width           =   1545
  95.    End
  96.    Begin VB.FileListBox File1 
  97.       BeginProperty Font 
  98.          Name            =   "Comic Sans MS"
  99.          Size            =   9.75
  100.          Charset         =   0
  101.          Weight          =   400
  102.          Underline       =   0   'False
  103.          Italic          =   0   'False
  104.          Strikethrough   =   0   'False
  105.       EndProperty
  106.       Height          =   1980
  107.       Left            =   3495
  108.       TabIndex        =   2
  109.       Top             =   150
  110.       Width           =   3060
  111.    End
  112.    Begin VB.DirListBox Dir1 
  113.       BeginProperty Font 
  114.          Name            =   "Comic Sans MS"
  115.          Size            =   9.75
  116.          Charset         =   0
  117.          Weight          =   400
  118.          Underline       =   0   'False
  119.          Italic          =   0   'False
  120.          Strikethrough   =   0   'False
  121.       EndProperty
  122.       Height          =   1290
  123.       Left            =   120
  124.       TabIndex        =   1
  125.       Top             =   840
  126.       Width           =   3180
  127.    End
  128.    Begin VB.DriveListBox Drive1 
  129.       BeginProperty Font 
  130.          Name            =   "Comic Sans MS"
  131.          Size            =   9.75
  132.          Charset         =   0
  133.          Weight          =   400
  134.          Underline       =   0   'False
  135.          Italic          =   0   'False
  136.          Strikethrough   =   0   'False
  137.       EndProperty
  138.       Height          =   390
  139.       Left            =   120
  140.       TabIndex        =   0
  141.       Top             =   150
  142.       Width           =   3180
  143.    End
  144. Attribute VB_Name = "FileDemoForm"
  145. Attribute VB_GlobalNameSpace = False
  146. Attribute VB_Creatable = False
  147. Attribute VB_PredeclaredId = True
  148. Attribute VB_Exposed = False
  149. Private Sub Command1_Click()
  150. ' Scan the contents of the DriveListBox control
  151. List1.Clear
  152. List1.AddItem "LIST OF DRIVES"
  153. For i = 0 To Drive1.ListCount - 1
  154.     List1.AddItem Drive1.List(i)
  155. End Sub
  156. Private Sub Command2_Click()
  157. ' Scan the contents of the DirListBox control
  158. List1.Clear
  159. List1.AddItem "LIST OF SUBFOLDERS"
  160. For i = 0 To Dir1.ListCount - 1
  161.     List1.AddItem Dir1.List(i)
  162. End Sub
  163. Private Sub Command3_Click()
  164. List1.Clear
  165. List1.AddItem "LIST OF PARENT FOLDERS"
  166. pDepth = -1
  167. While Dir1.List(pDepth) <> ""
  168.     List1.AddItem Dir1.List(pDepth)
  169.     pDepth = pDepth - 1
  170. List1.AddItem "The current folder is nested " & -pDepth + 1 & " folders deep"
  171. End Sub
  172. Private Sub Command4_Click()
  173. ' Scan the contents of the FileListBox control
  174. List1.Clear
  175. List1.AddItem "LIST OF FILES"
  176. For i = 0 To File1.ListCount - 1
  177.     List1.AddItem File1.List(i)
  178. End Sub
  179.