Home All Groups Group Topic Archive Search About

FileListBox from VB6?

Author
8 Aug 2006 10:14 PM
kokirichild
Hi All!

I've been scouring the web to no avail, but what I'm looking for is
something similar to the FileListBox that was there in VB6 but seems to
have been removed (or moved) in 2005.

Does anyone know of a way to display a list of files in a given
directory, and allow the user to select one?

Any help would be great!

Author
8 Aug 2006 10:49 PM
GhostInAK
Hello kokirich***@gmail.com,

Dim tOpenDlg as OpenFileDialog = New OpenFileDialog

if tOpenDlg.ShowDialog = DialogResult.OK then
'  The User selected tOpenDlg.Filename
end if

-Boo

Show quoteHide quote
> Hi All!
>
> I've been scouring the web to no avail, but what I'm looking for is
> something similar to the FileListBox that was there in VB6 but seems
> to have been removed (or moved) in 2005.
>
> Does anyone know of a way to display a list of files in a given
> directory, and allow the user to select one?
>
> Any help would be great!
>
Author
9 Aug 2006 7:25 AM
gene kelley
On Tue, 8 Aug 2006 22:49:42 +0000 (UTC), GhostInAK <ghosti***@gmail.com> wrote:

>Hello kokirich***@gmail.com,
>
>Dim tOpenDlg as OpenFileDialog = New OpenFileDialog
>
>if tOpenDlg.ShowDialog = DialogResult.OK then
>'  The User selected tOpenDlg.Filename
>end if
>
>-Boo
>


Interesting how limited OP descriptions can produce differing interpretations.
As the OP did not mention DriveList and DirList, but only the FileListBox, one assumption is that
the OP is not working on a FileDialog, but rather after the functionality of the FileListBox.  That
component was a specialized ListBox where simply using the Path property populated the box with all
the files in the directory specified in the Path Property.  Typical use might be a picture viewer
where selecting a particular item in the box loads and displays the picture file.  In this case,
OpenFileDialog would be inappropriate. 

Having said that, I would probably use and populate the NET ListBox component rather than using the
VB6 FileListBox.

Gene

Show quoteHide quote
>> I've been scouring the web to no avail, but what I'm looking for is
>> something similar to the FileListBox that was there in VB6 but seems
>> to have been removed (or moved) in 2005.
>>
>> Does anyone know of a way to display a list of files in a given
>> directory, and allow the user to select one?
>>
>> Any help would be great!
>>
>
Author
9 Aug 2006 3:38 PM
KokiriChild
Hi all,

Thanks for all your answers, but Gene hit it on the head!

I'm not after creating a dialogue, but like his picture viewer example
I need to populate a list box with the files in a given directory,
which when clicked on will launch another program etc, so a dialogue
box isn't suitable.

I've looked at the ListBox, but (and I'm probably just being dumb here)
I can't figure out how to get it to list the contents of a directory.

Another reason for wanting the FileListBox is that it needs to filter
out different file types based on user options - an easy operation in
VB6!

Gene - I've looked for it but can't seem to find it anywhere. Is there
any chance you could tell me step-by-step how to enable it?

Thanks in advance!

- KokiriChild

gene kelley wrote:
Show quoteHide quote
> On Tue, 8 Aug 2006 22:49:42 +0000 (UTC), GhostInAK <ghosti***@gmail.com> wrote:
>
> >Hello kokirich***@gmail.com,
> >
> >Dim tOpenDlg as OpenFileDialog = New OpenFileDialog
> >
> >if tOpenDlg.ShowDialog = DialogResult.OK then
> >'  The User selected tOpenDlg.Filename
> >end if
> >
> >-Boo
> >
>
>
> Interesting how limited OP descriptions can produce differing interpretations.
> As the OP did not mention DriveList and DirList, but only the FileListBox, one assumption is that
> the OP is not working on a FileDialog, but rather after the functionality of the FileListBox.  That
> component was a specialized ListBox where simply using the Path property populated the box with all
> the files in the directory specified in the Path Property.  Typical use might be a picture viewer
> where selecting a particular item in the box loads and displays the picture file.  In this case,
> OpenFileDialog would be inappropriate.
>
> Having said that, I would probably use and populate the NET ListBox component rather than using the
> VB6 FileListBox.
>
> Gene
>
> >> I've been scouring the web to no avail, but what I'm looking for is
> >> something similar to the FileListBox that was there in VB6 but seems
> >> to have been removed (or moved) in 2005.
> >>
> >> Does anyone know of a way to display a list of files in a given
> >> directory, and allow the user to select one?
> >>
> >> Any help would be great!
> >>
> >
Author
9 Aug 2006 3:47 PM
Cor Ligthert [MVP]
Kokiri,

If you start using a hammer, than please try to use a that tool first.

In other words, read all the answers before you start to hit.

http://msdn.microsoft.com/vbasic/default.aspx?pull=/library/en-us/dv_vstechart/html/vbpowerpack.asp#vbpowerpack_topic8

Cor

Show quoteHide quote
"KokiriChild" <kokirich***@gmail.com> schreef in bericht
news:1155137918.559803.327460@h48g2000cwc.googlegroups.com...
> Hi all,
>
> Thanks for all your answers, but Gene hit it on the head!
>
> I'm not after creating a dialogue, but like his picture viewer example
> I need to populate a list box with the files in a given directory,
> which when clicked on will launch another program etc, so a dialogue
> box isn't suitable.
>
> I've looked at the ListBox, but (and I'm probably just being dumb here)
> I can't figure out how to get it to list the contents of a directory.
>
> Another reason for wanting the FileListBox is that it needs to filter
> out different file types based on user options - an easy operation in
> VB6!
>
> Gene - I've looked for it but can't seem to find it anywhere. Is there
> any chance you could tell me step-by-step how to enable it?
>
> Thanks in advance!
>
> - KokiriChild
>
> gene kelley wrote:
>> On Tue, 8 Aug 2006 22:49:42 +0000 (UTC), GhostInAK <ghosti***@gmail.com>
>> wrote:
>>
>> >Hello kokirich***@gmail.com,
>> >
>> >Dim tOpenDlg as OpenFileDialog = New OpenFileDialog
>> >
>> >if tOpenDlg.ShowDialog = DialogResult.OK then
>> >'  The User selected tOpenDlg.Filename
>> >end if
>> >
>> >-Boo
>> >
>>
>>
>> Interesting how limited OP descriptions can produce differing
>> interpretations.
>> As the OP did not mention DriveList and DirList, but only the
>> FileListBox, one assumption is that
>> the OP is not working on a FileDialog, but rather after the functionality
>> of the FileListBox.  That
>> component was a specialized ListBox where simply using the Path property
>> populated the box with all
>> the files in the directory specified in the Path Property.  Typical use
>> might be a picture viewer
>> where selecting a particular item in the box loads and displays the
>> picture file.  In this case,
>> OpenFileDialog would be inappropriate.
>>
>> Having said that, I would probably use and populate the NET ListBox
>> component rather than using the
>> VB6 FileListBox.
>>
>> Gene
>>
>> >> I've been scouring the web to no avail, but what I'm looking for is
>> >> something similar to the FileListBox that was there in VB6 but seems
>> >> to have been removed (or moved) in 2005.
>> >>
>> >> Does anyone know of a way to display a list of files in a given
>> >> directory, and allow the user to select one?
>> >>
>> >> Any help would be great!
>> >>
>> >
>
Author
9 Aug 2006 3:49 PM
KokiriChild
Doh! Just found it! This is what you get for trying to program without
caffeine very late at night!

Thanks for all your help :-)

- KokiriChild

KokiriChild wrote:
Show quoteHide quote
> Hi all,
>
> Thanks for all your answers, but Gene hit it on the head!
>
> I'm not after creating a dialogue, but like his picture viewer example
> I need to populate a list box with the files in a given directory,
> which when clicked on will launch another program etc, so a dialogue
> box isn't suitable.
>
> I've looked at the ListBox, but (and I'm probably just being dumb here)
> I can't figure out how to get it to list the contents of a directory.
>
> Another reason for wanting the FileListBox is that it needs to filter
> out different file types based on user options - an easy operation in
> VB6!
>
> Gene - I've looked for it but can't seem to find it anywhere. Is there
> any chance you could tell me step-by-step how to enable it?
>
> Thanks in advance!
>
> - KokiriChild
>
> gene kelley wrote:
> > On Tue, 8 Aug 2006 22:49:42 +0000 (UTC), GhostInAK <ghosti***@gmail.com> wrote:
> >
> > >Hello kokirich***@gmail.com,
> > >
> > >Dim tOpenDlg as OpenFileDialog = New OpenFileDialog
> > >
> > >if tOpenDlg.ShowDialog = DialogResult.OK then
> > >'  The User selected tOpenDlg.Filename
> > >end if
> > >
> > >-Boo
> > >
> >
> >
> > Interesting how limited OP descriptions can produce differing interpretations.
> > As the OP did not mention DriveList and DirList, but only the FileListBox, one assumption is that
> > the OP is not working on a FileDialog, but rather after the functionality of the FileListBox.  That
> > component was a specialized ListBox where simply using the Path property populated the box with all
> > the files in the directory specified in the Path Property.  Typical use might be a picture viewer
> > where selecting a particular item in the box loads and displays the picture file.  In this case,
> > OpenFileDialog would be inappropriate.
> >
> > Having said that, I would probably use and populate the NET ListBox component rather than using the
> > VB6 FileListBox.
> >
> > Gene
> >
> > >> I've been scouring the web to no avail, but what I'm looking for is
> > >> something similar to the FileListBox that was there in VB6 but seems
> > >> to have been removed (or moved) in 2005.
> > >>
> > >> Does anyone know of a way to display a list of files in a given
> > >> directory, and allow the user to select one?
> > >>
> > >> Any help would be great!
> > >>
> > >
Author
9 Aug 2006 7:18 PM
gene kelley
Show quote Hide quote
On 9 Aug 2006 08:38:38 -0700, "KokiriChild" <kokirich***@gmail.com> wrote:

>Hi all,
>
>Thanks for all your answers, but Gene hit it on the head!
>
>I'm not after creating a dialogue, but like his picture viewer example
>I need to populate a list box with the files in a given directory,
>which when clicked on will launch another program etc, so a dialogue
>box isn't suitable.
>
>I've looked at the ListBox, but (and I'm probably just being dumb here)
>I can't figure out how to get it to list the contents of a directory.
>
>Another reason for wanting the FileListBox is that it needs to filter
>out different file types based on user options - an easy operation in
>VB6!
>
>Gene - I've looked for it but can't seem to find it anywhere. Is there
>any chance you could tell me step-by-step how to enable it?
>
>Thanks in advance!
>
>- KokiriChild
>


Here with VB2005 Pro IDE:

Menu "Tool", "Choose Toolbox Items" (make take several seconds to show the dialog).
When the dialog shows, find "FileListBox" in the left column and 'check' it to add to the ToolBox.

Gene











Show quoteHide quote
>gene kelley wrote:
>> On Tue, 8 Aug 2006 22:49:42 +0000 (UTC), GhostInAK <ghosti***@gmail.com> wrote:
>>
>> >Hello kokirich***@gmail.com,
>> >
>> >Dim tOpenDlg as OpenFileDialog = New OpenFileDialog
>> >
>> >if tOpenDlg.ShowDialog = DialogResult.OK then
>> >'  The User selected tOpenDlg.Filename
>> >end if
>> >
>> >-Boo
>> >
>>
>>
>> Interesting how limited OP descriptions can produce differing interpretations.
>> As the OP did not mention DriveList and DirList, but only the FileListBox, one assumption is that
>> the OP is not working on a FileDialog, but rather after the functionality of the FileListBox.  That
>> component was a specialized ListBox where simply using the Path property populated the box with all
>> the files in the directory specified in the Path Property.  Typical use might be a picture viewer
>> where selecting a particular item in the box loads and displays the picture file.  In this case,
>> OpenFileDialog would be inappropriate.
>>
>> Having said that, I would probably use and populate the NET ListBox component rather than using the
>> VB6 FileListBox.
>>
>> Gene
>>
>> >> I've been scouring the web to no avail, but what I'm looking for is
>> >> something similar to the FileListBox that was there in VB6 but seems
>> >> to have been removed (or moved) in 2005.
>> >>
>> >> Does anyone know of a way to display a list of files in a given
>> >> directory, and allow the user to select one?
>> >>
>> >> Any help would be great!
>> >>
>> >
Author
10 Aug 2006 3:18 AM
GhostInAK
Hello gene,

Too right.  My answer came about as the end result of some quick assumptions
and personal preferences:
1.  That the OP knew how to use their tools.  I seem to have made the wrong
assumption here.  I'd hate to see what they would do if their job was building
demolition or diamond cutting..

2.  That in today's age of flashy UIs one would want something a little more
up-to-date than the dated FileListBox.

3.  That the VB6 compatibility controls suck ass in general.

4.  Seeing as assumptions 1, 2, and 3 had to be correct, the user must just
want to just provide a mechanism for selecting files, since (according to
the first 3 assumptions) they couldnt possibly want to be displaying them
on-screen.

But, seeing as how everyday on here seems to be amature hour, I don't feel
bad.  You get what you pay for.

-Boo

Show quoteHide quote
> On Tue, 8 Aug 2006 22:49:42 +0000 (UTC), GhostInAK
> <ghosti***@gmail.com> wrote:
>
>> Hello kokirich***@gmail.com,
>>
>> Dim tOpenDlg as OpenFileDialog = New OpenFileDialog
>>
>> if tOpenDlg.ShowDialog = DialogResult.OK then
>> '  The User selected tOpenDlg.Filename
>> end if
>> -Boo
>>
> Interesting how limited OP descriptions can produce differing
> interpretations.
> As the OP did not mention DriveList and DirList, but only the
> FileListBox, one assumption is that
> the OP is not working on a FileDialog, but rather after the
> functionality of the FileListBox.  That
> component was a specialized ListBox where simply using the Path
> property populated the box with all
> the files in the directory specified in the Path Property.  Typical
> use might be a picture viewer
> where selecting a particular item in the box loads and displays the
> picture file.  In this case,
> OpenFileDialog would be inappropriate.
> Having said that, I would probably use and populate the NET ListBox
> component rather than using the VB6 FileListBox.
>
> Gene
>
>>> I've been scouring the web to no avail, but what I'm looking for is
>>> something similar to the FileListBox that was there in VB6 but seems
>>> to have been removed (or moved) in 2005.
>>>
>>> Does anyone know of a way to display a list of files in a given
>>> directory, and allow the user to select one?
>>>
>>> Any help would be great!
>>>
Author
8 Aug 2006 11:22 PM
gene kelley
On 8 Aug 2006 15:14:26 -0700, kokirich***@gmail.com wrote:

>Hi All!
>
>I've been scouring the web to no avail, but what I'm looking for is
>something similar to the FileListBox that was there in VB6 but seems to
>have been removed (or moved) in 2005.
>
>Does anyone know of a way to display a list of files in a given
>directory, and allow the user to select one?
>
>Any help would be great!

The old FleListBox is still available in VB2005.  You will have to add it to the ToolBox to use it
as it is not in the ToolBox by default.

Gene
Author
9 Aug 2006 4:38 AM
Cor Ligthert [MVP]
Hi,

The old FileListBox from VB6 is available in the Visual Basic powertools (or
something). But do you really need that, the ShowDialog introduced in VB
2003 is much nicer.

Cor

<kokirich***@gmail.com> schreef in bericht
Show quoteHide quote
news:1155075266.661900.275100@b28g2000cwb.googlegroups.com...
> Hi All!
>
> I've been scouring the web to no avail, but what I'm looking for is
> something similar to the FileListBox that was there in VB6 but seems to
> have been removed (or moved) in 2005.
>
> Does anyone know of a way to display a list of files in a given
> directory, and allow the user to select one?
>
> Any help would be great!
>