Click to See Complete Forum and Search --> : VB6 - Drive, Dir, File ListBox
shahp
August 22nd, 2001, 02:29 PM
I am developing a form for the user Interface and I want to give user an ability to browse file/dir/drive list box to choose the file as an input. I don't know how to synchronise all three controls to work together on the form. I have following three controls on my form.
1) DriveListBox
2) DirListBox and
3) FileListBox
If I get the code sample from somebody for this, I will really apreciate it.
Thanks,
Pshah
Ghost308
August 22nd, 2001, 02:37 PM
You could do that with something like this...
private Sub Dir1_Change()
File1.Path = Dir1.Path
End Sub
private Sub Drive1_Change()
Dir1.Path = Drive1.Drive
End Sub
But have you thought about using the CommonDialog control? All you would have to do is load the control into the project, apply the control to the form and use this code..
CommonDialog1.ShowOpen
MyFile = CommonDialog1.Filename
hoa01206
August 22nd, 2001, 04:46 PM
Hi,
Put the three controls on a form:
This will help a little in what you are doing
Private Sub Drive1_Change()
Dir1.Path = Drive1.Drive
End Sub
Private Sub Dir1_Change()
File1.Path = Dir1.Path
End Sub
Private Sub File1_Click()
End Sub
check it out
Thanks
Hisham
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.