473,386 Members | 1,801 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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 3183
* "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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Craig Keightley | last post by:
Can these lines of sql statements be consolidated into one sql statement (possibly using reg exps??) BEGIN CODE ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Update...
12
by: Barnes | last post by:
Does anyone know of a good way to use the JavaScript string.replace() method in an ASP form? Here is the scenario: I have a form that cannot accept apostrophes. I want to use the replace() so...
6
by: Danny | last post by:
I need an asp command to strip out from a string all extra punctuation such as apostrophe, comma, period, spaces dashes, etc etc and just leave the letters. Can anybody give me some ideas? ...
9
by: Peter Row | last post by:
Hi, I know this has been asked before, but reading the threads it is still not entirely clear. Deciding which .Replace( ) to use when. Typically if I create a string in a loop I always use a...
4
by: Cor | last post by:
Hi Newsgroup, I have given an answer in this newsgroup about a "Replace". There came an answer on that I did not understand, so I have done some tests. I got the idea that someone said,...
3
by: Goran Djuranovic | last post by:
Hi all, I ran into a problem where my XMLTextReader fails on .Read() when I have "<" character in one of the attribute's values. What I am trying to do is replace illegal characters ("<", "&" ,...
3
by: TOXiC | last post by:
Hi everyone, First I say that I serched and tryed everything but I cannot figure out how I can do it. I want to open a a file (not necessary a txt) and find and replace a string. I can do it...
6
by: JackpipE | last post by:
Here is my replace query and I need to run this on every column in my table. Right now I manually enter the column name (_LANGUAGES_SPOKEN) but this is time consuming and would like to automate...
5
by: V S Rawat | last post by:
I was trying to use back-to-back replace functions to convert a url: str1 = str.replace("%2F","/").replace("%3F","?").replace("%3D","=").replace("%2 6","&"); It didn't replace all 4 types of...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.