FileListBox from VB6?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • kokirichild@gmail.com

    FileListBox from VB6?

    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!

  • GhostInAK

    #2
    Re: FileListBox from VB6?

    Hello kokirichild@gma il.com,

    Dim tOpenDlg as OpenFileDialog = New OpenFileDialog

    if tOpenDlg.ShowDi alog = DialogResult.OK then
    ' The User selected tOpenDlg.Filena me
    end if

    -Boo
    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!
    >

    Comment

    • gene kelley

      #3
      Re: FileListBox from VB6?

      On 8 Aug 2006 15:14:26 -0700, kokirichild@gma il.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

      Comment

      • Cor Ligthert [MVP]

        #4
        Re: FileListBox from VB6?

        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

        <kokirichild@gm ail.comschreef in bericht
        news:1155075266 .661900.275100@ b28g2000cwb.goo glegroups.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!
        >

        Comment

        • gene kelley

          #5
          Re: FileListBox from VB6?

          On Tue, 8 Aug 2006 22:49:42 +0000 (UTC), GhostInAK <ghostinak@gmai l.comwrote:
          >Hello kokirichild@gma il.com,
          >
          >Dim tOpenDlg as OpenFileDialog = New OpenFileDialog
          >
          >if tOpenDlg.ShowDi alog = DialogResult.OK then
          >' The User selected tOpenDlg.Filena me
          >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!
          >>
          >

          Comment

          • KokiriChild

            #6
            Re: FileListBox from VB6?

            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 <ghostinak@gmai l.comwrote:
            >
            Hello kokirichild@gma il.com,

            Dim tOpenDlg as OpenFileDialog = New OpenFileDialog

            if tOpenDlg.ShowDi alog = DialogResult.OK then
            ' The User selected tOpenDlg.Filena me
            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!
            >

            Comment

            • KokiriChild

              #7
              Re: FileListBox from VB6?

              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:
              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 <ghostinak@gmai l.comwrote:
              >Hello kokirichild@gma il.com,
              >
              >Dim tOpenDlg as OpenFileDialog = New OpenFileDialog
              >
              >if tOpenDlg.ShowDi alog = DialogResult.OK then
              >' The User selected tOpenDlg.Filena me
              >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!
              >>
              >

              Comment

              • Cor Ligthert [MVP]

                #8
                Re: FileListBox from VB6?

                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.



                Cor

                "KokiriChil d" <kokirichild@gm ail.comschreef in bericht
                news:1155137918 .559803.327460@ h48g2000cwc.goo glegroups.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 <ghostinak@gmai l.com>
                >wrote:
                >>
                >Hello kokirichild@gma il.com,
                >
                >Dim tOpenDlg as OpenFileDialog = New OpenFileDialog
                >
                >if tOpenDlg.ShowDi alog = DialogResult.OK then
                >' The User selected tOpenDlg.Filena me
                >end if
                >
                >-Boo
                >
                >>
                >>
                >Interesting how limited OP descriptions can produce differing
                >interpretation s.
                >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,
                >OpenFileDial og 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!
                >>
                >
                >

                Comment

                • gene kelley

                  #9
                  Re: FileListBox from VB6?

                  On 9 Aug 2006 08:38:38 -0700, "KokiriChil d" <kokirichild@gm ail.comwrote:
                  >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 "FileListBo x" in the left column and 'check' it to add to the ToolBox.

                  Gene










                  >gene kelley wrote:
                  >On Tue, 8 Aug 2006 22:49:42 +0000 (UTC), GhostInAK <ghostinak@gmai l.comwrote:
                  >>
                  >Hello kokirichild@gma il.com,
                  >
                  >Dim tOpenDlg as OpenFileDialog = New OpenFileDialog
                  >
                  >if tOpenDlg.ShowDi alog = DialogResult.OK then
                  >' The User selected tOpenDlg.Filena me
                  >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,
                  >OpenFileDial og 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!
                  >>
                  >

                  Comment

                  • GhostInAK

                    #10
                    Re: FileListBox from VB6?

                    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
                    On Tue, 8 Aug 2006 22:49:42 +0000 (UTC), GhostInAK
                    <ghostinak@gmai l.comwrote:
                    >
                    >Hello kokirichild@gma il.com,
                    >>
                    >Dim tOpenDlg as OpenFileDialog = New OpenFileDialog
                    >>
                    >if tOpenDlg.ShowDi alog = DialogResult.OK then
                    >' The User selected tOpenDlg.Filena me
                    >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!
                    >>>

                    Comment

                    • KokiriChild

                      #11
                      Re: FileListBox from VB6?

                      Ok, before I let this go to rest I just want to say a few things :-)

                      Cor Ligthert: Thanks for the link, but I'd already found the control
                      when you'd posted. Also thanks for your help the first time round.
                      Can't see why you said the thing about the hammer considering you
                      couldn't provide a response the first time round. It's like me looking
                      for a hammer, and you said "nah, use the nail-gun". Gene told me where
                      the hammer was and you then got all pissy because you thought I might
                      be going for the nail-gun when I should've used the hammer.

                      GhostInAK: I dunno what you've got shoved up your arse, but suggest you
                      remove it. The OP doesn't nessecaraly know how to use the tools as this
                      may not be the OP's job. Infact, this isn't the OP's job, neither is
                      the OP a demolition expert or a diamond cutter. The OP does all 3 for
                      hobbies. You have provided NOTHING to this discussion, other than a
                      reminder of why I never use newsgroups - You get a bunch of elitest
                      assholes such as yourself who presume to know everything and never give
                      anyone the answers they're looking for. You presumed I was wanting to
                      create a dialogue box - you were wrong. You presume I want a flashy GUI
                      - You're wrong. "RTFM!"? - Get a fucking life!

                      Gene: You're the only one who was polite and helpful throughout. It
                      pains me that for every Gene out there, there are 20 GhostInAKs. You
                      read my question and answered it as I wanted it, and made no
                      assumptions about my program, why I wanted the controls or trying to
                      impose your flashy-GUI-diamond-cutting attitude upon me (and I doubt
                      you even have one). Thanks for not letting this experience be a total
                      waste, you're a pearl amongst the pigshit!

                      - KokiriChild

                      GhostInAK wrote:
                      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
                      >
                      On Tue, 8 Aug 2006 22:49:42 +0000 (UTC), GhostInAK
                      <ghostinak@gmai l.comwrote:
                      Hello kokirichild@gma il.com,
                      >
                      Dim tOpenDlg as OpenFileDialog = New OpenFileDialog
                      >
                      if tOpenDlg.ShowDi alog = DialogResult.OK then
                      ' The User selected tOpenDlg.Filena me
                      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!
                      >>

                      Comment

                      Working...