|
-
May 24th, 2002, 01:04 PM
#1
Thread Starter
New Member
Stupid Question
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)
-
May 25th, 2002, 03:29 AM
#2
Hyperactive Member
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
-
May 28th, 2002, 09:27 AM
#3
Thread Starter
New Member
Thanks I'll look into that as well.
-
May 28th, 2002, 09:50 AM
#4
Thread Starter
New Member
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.
-
May 29th, 2002, 08:33 PM
#5
New Member
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...
-
May 30th, 2002, 01:02 AM
#6
Dazed Member
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()
-
May 30th, 2002, 07:12 AM
#7
Thread Starter
New Member
Thanks all.........I will check these out!
-
May 30th, 2002, 07:57 AM
#8
Thread Starter
New Member
Okay one last stupid question........where would I go to add the libraries? Is it under the 'Add a reference' option?
-
May 30th, 2002, 11:05 AM
#9
New Member
Right-click on your toolbar, pick 'Customize Toolbar', and choose the '.NET Framework Components' tab. They're all there.
-
May 30th, 2002, 11:06 AM
#10
Thread Starter
New Member
Cool. THanks for helping a n00bie out!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|