文件系统控件联动.frm

来自「vb编程+从基础到实践光盘代码」· FRM 代码 · 共 62 行

FRM
62
字号
VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "Form1"
   ClientHeight    =   2985
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   4350
   LinkTopic       =   "Form1"
   ScaleHeight     =   2985
   ScaleWidth      =   4350
   StartUpPosition =   3  '窗口缺省
   Begin VB.TextBox Text1 
      Height          =   375
      Left            =   2400
      TabIndex        =   3
      Top             =   240
      Width           =   1815
   End
   Begin VB.FileListBox File1 
      Height          =   1890
      Left            =   2400
      TabIndex        =   2
      Top             =   720
      Width           =   1815
   End
   Begin VB.DriveListBox Drive1 
      Height          =   300
      Left            =   360
      TabIndex        =   1
      Top             =   240
      Width           =   1815
   End
   Begin VB.DirListBox Dir1 
      Height          =   1980
      Left            =   360
      TabIndex        =   0
      Top             =   720
      Width           =   1815
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Private Sub Form_Load()
  Text1.Text = " "
  Drive1.Drive = "c:\"
  File1.Pattern = "*.txt;*.exe"
End Sub
Private Sub Drive1_Change()
  Dir1.Path = Drive1.Drive '使驱动器列表框和目录列表框同步
End Sub
Private Sub Dir1_Change()
  File1.Path = Dir1.Path '使目录列表框和文件列表框同步
End Sub
Private Sub File1_Click()
  Text1.Text = File1.FileName '在文本框中显示文件名
End Sub

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?