468,512 Members | 1,390 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,512 developers. It's quick & easy.

How to replace the VB4 DirList box in VB .NET

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.
Nov 20 '05 #1
6 3078
* "Brian Worth" <Noname@Nowhere> scripsit:
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>

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #2
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

"
Nov 20 '05 #3
Herfreid has really had a face lift, he looks 22, but he is actually like
the professor on Futurama !

LOL - OHM

Cor wrote:
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

"


--
Best Regards - OHM

O_H_M{at}BTInternet{dot}com
Nov 20 '05 #4
* "Cor" <no*@non.com> scripsit:
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.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #5
* "One Handed Man" <O_************************@BTInternet.com> scripsit:
Herfreid has really had a face lift, he looks 22, but he is actually like
the professor on Futurama !


Who's Herfreid?

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #6
Thanks Herfried. That's exactly what I wanted.

Regards,

Brian.

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:%2******************@TK2MSFTNGP10.phx.gbl...
* "Brian Worth" <Noname@Nowhere> scripsit:
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/downlo...9a-a293-f8f1d0
cc0efb/DirListBox.msi>
--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>

Nov 20 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Craig Keightley | last post: by
6 posts views Thread by JackpipE | last post: by
1 post views Thread by fmendoza | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.