📄 form1001.frm
字号:
VERSION 5.00
Begin VB.Form Form1
Caption = "显示文件内容"
ClientHeight = 3090
ClientLeft = 60
ClientTop = 450
ClientWidth = 5520
LinkTopic = "Form1"
ScaleHeight = 3090
ScaleWidth = 5520
StartUpPosition = 3 '窗口缺省
Begin VB.TextBox Text1
Height = 2415
Left = 3120
MultiLine = -1 'True
ScrollBars = 3 'Both
TabIndex = 3
Top = 480
Width = 2175
End
Begin VB.DirListBox Dir1
Height = 2190
Left = 240
TabIndex = 2
Top = 240
Width = 1335
End
Begin VB.DriveListBox Drive1
Height = 300
Left = 240
TabIndex = 1
Top = 2640
Width = 1335
End
Begin VB.FileListBox File1
Height = 2610
Left = 1680
Pattern = "*.txt"
TabIndex = 0
Top = 240
Width = 1335
End
Begin VB.Label Label1
Height = 375
Left = 3240
TabIndex = 4
Top = 120
Width = 1455
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub Dir1_Change()
'改变目录
File1.Path = Dir1.Path
End Sub
Private Sub Drive1_Change()
'改变驱动器
Dir1.Path = Drive1.Drive
End Sub
Private Sub File1_Click()
Dim NextLine
Dim F1
Dim FileN As Integer
FileN = FreeFile
Label1.Caption = File1.FileName ' 显示文件名
F1 = Dir1.Path & "\" & File1.FileName
'打开文件
Open F1 For Input As FileN
Do While Not EOF(1)
Line Input #FileN, NextLine
Text1.Text = Text1.Text + NextLine + Chr(13) + Chr(10)
Loop
Text1.Refresh
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -