建立一个文本浏览器。窗体上放置驱动器列表框、目录列表框、文件列表框和两个文本框,运行界面如图3-3所示
答案:1 悬赏:30 手机版
解决时间 2021-03-25 08:23
- 提问者网友:萌卜娃娃
- 2021-03-24 20:05
建立一个文本浏览器。窗体上放置驱动器列表框、目录列表框、文件列表框和两个文本框,运行界面如图3-3所示
最佳答案
- 五星知识达人网友:孤独入客枕
- 2021-03-24 21:32
Private Sub Dir1_Change()
File1.Path = Dir1.Path
End Sub
Private Sub Drive1_Change()
Dir1.Path = Drive1.Drive
End Sub
Private Sub File1_Click()
Text1.Text = Dir1.Path & File1.FileName
Text2 = ""
Open Text1.Text For Input As #1
Do Until EOF(1)
Line Input #1, a
Text2 = Text2 & a
Text2 = Text2 & Chr(13) & Chr(10)
Loop
Close (1)
End Sub
Private Sub File1_DblClick()
Shell "notepad " & File1.Path & File1.FileName, vbNormalFocus
End Sub
Private Sub Form_Load()
File1.Pattern = "*.txt"
End Sub
File1.Path = Dir1.Path
End Sub
Private Sub Drive1_Change()
Dir1.Path = Drive1.Drive
End Sub
Private Sub File1_Click()
Text1.Text = Dir1.Path & File1.FileName
Text2 = ""
Open Text1.Text For Input As #1
Do Until EOF(1)
Line Input #1, a
Text2 = Text2 & a
Text2 = Text2 & Chr(13) & Chr(10)
Loop
Close (1)
End Sub
Private Sub File1_DblClick()
Shell "notepad " & File1.Path & File1.FileName, vbNormalFocus
End Sub
Private Sub Form_Load()
File1.Pattern = "*.txt"
End Sub
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯