FileListBox
I am new to programming and bought a version of VB 6.0 (years ago) and I am finally getting around to learning how to write programs.
I want to write a program that allows me to select a drive and then a directory from that drive. Then display all the files of a similar file type in seperate FileListBoxes.
All the .doc files in one list box all the .pdf's in another and .xls file in yet another. At which point I want to be able to double click the file and open it up.
I have the select the drive and directory thing down, but the actual filelistboxes with *.doc or *.pdf is giving me trouble.
Any help would be well, helpful.
Thanks,
Mike
# 1 Re: FileListBox
Hi, Mike: To select a drive and directory, you may use Windows' standard Browse For Folder dialog: http://www.freevbcode.com/ShowCode.asp?ID=3064
To populate a FileListBox control with files with a specific extension, set the control's .Pattern property. You may find this article helpful: http://abstractvb.com/code.asp?A=709
Finally, to open a file when the user double-clicks on it, you may use Windows' ShelLExecute API function: http://www.google.com/search?q=vb+shellexecute
Give it a try and let us know if you get stuck!