xjnzhidao您好:您请教个问题,在vb中,当通过DrivezListBox和DirListBox选择文件夹时,如何显示路径?
多谢,期待您的回答。 展开
Dim s As String
Open Label1.Caption + "\zf.txt" For Input As #1
Input #1, s
Close #1
End Sub
Private Sub Dir1_Change()
Label1.Caption = Dir1.Path
End Sub
Private Sub Drive1_Change()
Dir1.Path = Drive1.Drive
End Sub
如果zf.txt中的某一行为CFL=5.0如何将这个5.0显示在text2.text中,并可以进行修改,在text2.text中将5.0修改为6.0时,zf.txt中的这一行也变为CFL=6.0????谢谢
text1属性设置:multiline=true scrollbars=2
Private Sub Command1_Click()
Dim s As String
Open Label1.Caption + "zf.txt" For Input As #1
Do Until EOF(1)
Line Input #1, s
Text1.Text = Text1.Text + s + Chr(13) + Chr(10)
Loop
Close #1
ischange = True
End Sub
Private Sub Dir1_Change()
Label1.Caption = Dir1.Path
End Sub
Private Sub Drive1_Change()
Dir1.Path = Drive1.Drive
End Sub
Private Sub Form_Load()
ischange = False
End Sub
Private Sub Text1_Change()
If ischange = True Then
Open Label1.Caption + "zf.txt" For Output As #1
Print #1, Text1.Text
Close #1
End If
End Sub