Computing.Net > Forums > Programming > vb6 dirlistbox

Computing.Net: Over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to sign up now, it's free!

vb6 dirlistbox

Reply to Message Icon

Original Message
Name: ajturneruk
Date: July 8, 2003 at 08:33:41 Pacific
Subject: vb6 dirlistbox
OS: xp sp2
CPU/Ram: athlon1.3, 256
Comment:

how do you use the drivelistbox, dirlistbox and filelistbox options in vb ?? ie, i want to make a simple program to beable to select the drive, then particualr folder, to open a certain file...so i basically need the coding that links the three together. Cheers


Report Offensive Message For Removal


Response Number 1
Name: egkenny
Date: July 8, 2003 at 09:36:49 Pacific
Reply: (edit)

In this example I created four objects:
DriveListBox called DriveList
DirListBox called DirList
FileListBox called FileList
CommandButton called RenameCommand

The user can navigate the drives and directories by
selecting them with the mouse. If the user highlights
a file in the FileList and clicks on RenameCommand the
file is renamed to "newfile"

Private Sub DriveList_Change()
    DirList.Path = DriveList.Drive
End Sub

Private Sub DirList_Change()
    FileList.Path = DirList.Path
End Sub

Private Sub RenameCommand_Click()
    OldName = FileList.Path
    If Right$(OldName, 1) <> "\" Then
        OldName = OldName + "\"
    End If
    NewName = OldName
    OldName = OldName + FileList.FileName
    NewName = NewName + "newfile"
    Name OldName As NewName
    FileList.Refresh
End Sub


Report Offensive Follow Up For Removal







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home








Do you have your own blog?

Yes
No
I did before
I will soon


View Results

Poll Finishes In 4 Days.
Discuss in The Lounge
Poll History




Data Recovery Software