Okay I know there was a Drive list box in VB6 but I seem to not be able to find one in .NET........is it gone or am I missing something?
(sorry, bit of a newbie)
Printable View
Okay I know there was a Drive list box in VB6 but I seem to not be able to find one in .NET........is it gone or am I missing something?
(sorry, bit of a newbie)
did you have a look at using the Treeview control - haven't had to do anything like that myself but it seemed to be the most likely control
Thanks I'll look into that as well.
Okay I found how to list the drives in a combo box but now (remember I'm a newbie learning this on my own) how can I get it to list the files and directories in a listbox I have when someone selects a drive?
Thanks for you help.
If you want, you can dig into the VB6 Compatibility Libraries and use the DriveBox / DirBox / FileBox controls.
Maybe not the best solution, but it worked for one quick and dirty project I had concerning using a Find/Replace routine on filenames...
My Visual Basic is a little rusty but couldn't you use an OpenFileDialog for this? It should list all of the drives on the machine, plus if you know the specific drive that you want to query you could set the initial directory.
Code:
OpenFileDialog1.InitialDirectory = "C:\"
' you can also map a filter to the directory if you wanted to.
OpenFileDialog..Filter = "TextFiles|*.txt|AllFiles| *.*|ExcelFiles|*.xls"
OpenFileDialog.FilterIndex = 3
OpenFileDialog.RestoreDirectory = True
OpenFileDialog.ShowDialog()
Thanks all.........I will check these out!
Okay one last stupid question........where would I go to add the libraries? Is it under the 'Add a reference' option?
Right-click on your toolbar, pick 'Customize Toolbar', and choose the '.NET Framework Components' tab. They're all there.
Cool. THanks for helping a n00bie out!