How to replace the VB4 DirList box in VB .NET

B

Brian Worth

I've just upgraded to VB .NET 2002 Standard. I had an old VB4 program which
consisted of a form containing DriveListBox and a DirListBox and a Go
button.

The program would allow me to select a drive and navigate through to the
lowest level directory of a tree and return the full path down to the lowest
level.
The program would then obtain the list of members using DIR$(fullpathname)
and use FileCopy to copy them to a floppy disk - but storing them on the
floppy with just the lowest level directory name.

As an example, I'd use the DriveListBox to select C: which would cause the
DirListBox to show C:\. Assuming a directory structure of C:\Files\Test\Data
existed, I could navigate down to Data and the string C:\Data\Test\Data
would be returned by the DirListBox. Dir$("C:\Data\Test\Data") would then be
used to return members which would be stored in A:\Data\.

I'm trying to upgrade the program to VB. NET 2002. I see that DriveListBox
and DirListBox aren't supported anymore. I don't have the conversion wizard
as that doesn't come with the Standard version of VB .NET 2002 so I don't
have the compatibility library.

The help indicates that OpenFileDialogBox can replace the two list boxes -
but I can't seem to get this to stop at the lowest level of a directory and
return the full path name down to that inclusive. When I select the lowest
level, it insists on returning the first file name in that lowest level
directory. So in the above example, it will allow me to naviagate down to
C:\Data\Test\Data but if I highlight Data and click Open it then selects the
first file and wants to return that name.

I've tried looking at the help again and notice there is a Directory and a
DirectoryInfo class but examples of how these can be used aren't shown. I'm
very new to VB .NET 2002 and may be missing something obvious so any helpful
hints and tips would be welcome on what the best way to achieve the results
shown in the third paragraph.

Regards,

Brian.
 
H

Herfried K. Wagner [MVP]

* "Brian Worth said:
I've just upgraded to VB .NET 2002 Standard. I had an old VB4 program which
consisted of a form containing DriveListBox and a DirListBox and a Go
button.

The program would allow me to select a drive and navigate through to the
lowest level directory of a tree and return the full path down to the lowest
level.
The program would then obtain the list of members using DIR$(fullpathname)
and use FileCopy to copy them to a floppy disk - but storing them on the
floppy with just the lowest level directory name.

You will find a "replacement" for the DirListBox here:

<http://download.microsoft.com/download/8/0/3/8038df53-4450-409a-a293-f8f1d0cc0efb/DirListBox.msi>
 
C

Cor

Hi Herfried,

Did you already played with computers when you not even was on the
kintergarten (I do not know how to write but it has something to do with
Austria).

:))

Cor

"
 
O

One Handed Man

Herfreid has really had a face lift, he looks 22, but he is actually like
the professor on Futurama !

LOL - OHM
 
H

Herfried K. Wagner [MVP]

* "Cor said:
Did you already played with computers when you not even was on the
kintergarten (I do not know how to write but it has something to do with
Austria).

I didn't have a computer at the time I was in Kindergarten. I started
playing around with computers some years ago.
 
H

Herfried K. Wagner [MVP]

* "One Handed Man said:
Herfreid has really had a face lift, he looks 22, but he is actually like
the professor on Futurama !

Who's Herfreid?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top