Drive List Box

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Marge

    Drive List Box

    are there any examples of suggested methods to get the same results as
    the old DriveListBox & DirListBox from VB6.

    Express uses the openfiledialog but examples would be a great time
    saver, useful to see things in action to get a better idea.

    The openfiledialog isn't a visible object so I'm guesiing its used in
    conjuction with a standard combobox?
  • James Hahn

    #2
    Re: Drive List Box

    The file dialogs replace the whole set of controls you needed in earlier
    versions of VB - the call to the dialog returns the selected file, so there
    is no need for any list box.

    If you really have to create and manage your own list of files, use the
    FolderBrowserDi alog, Directory.GetFi les and a FileInfo object, and whatever
    type of collection you prefer.


    "Marge" <marge1963@goog lemail.comwrote in message
    news:b242b95d-d73f-43a8-af58-fba3ccc05bdd@r6 6g2000hsg.googl egroups.com...
    are there any examples of suggested methods to get the same results as
    the old DriveListBox & DirListBox from VB6.
    >
    Express uses the openfiledialog but examples would be a great time
    saver, useful to see things in action to get a better idea.
    >
    The openfiledialog isn't a visible object so I'm guesiing its used in
    conjuction with a standard combobox?

    Comment

    • Marge

      #3
      Re: Drive List Box

      On 22 Sep, 10:43, "James Hahn" <jh...@yahoo.co mwrote:

      Thanks James,

      did copy & run the code sample, its a useful learning sample for me
      but I did really want the visual effect of a drive list & folder list
      which give the user visual clues to where they are continually.

      The project I was re-writing in Express was a very simple sound file
      player, just wanted the practice of writing it in .net but it seems
      too difficult unless I add com references to the project which sort of
      defeats the object.

      Comment

      • =?Utf-8?B?S2VycnkgTW9vcm1hbg==?=

        #4
        Re: Drive List Box

        Marge,

        Environment.Get LogicalDrives returns an array containing the names of the
        logical drives on the current computer. You could display the array in a
        listbox or combobox as a way to emulate the Drive list box.

        Directory.GetDi rectories gets the names of subdirectories in a specified
        directory. You could display the results in a listbox, etc.

        Directory.GetFi les gets the names of files in a particular directory. You
        could display the results in a listbox, etc.

        Kerry Moorman

        "Marge" wrote:
        On 22 Sep, 10:43, "James Hahn" <jh...@yahoo.co mwrote:
        >
        Thanks James,
        >
        did copy & run the code sample, its a useful learning sample for me
        but I did really want the visual effect of a drive list & folder list
        which give the user visual clues to where they are continually.
        >
        The project I was re-writing in Express was a very simple sound file
        player, just wanted the practice of writing it in .net but it seems
        too difficult unless I add com references to the project which sort of
        defeats the object.
        >

        Comment

        • GHim

          #5
          Re: Drive List Box

          Check out Shell MegaPack shell browser UI components from

          Same as Windows Explorer, plus controls so they sit right on your own form
          (unlike OpenFileDialog) .
          They are commercial though.

          GHim

          "Marge" <marge1963@goog lemail.comwrote in message
          news:dfd8fb7e-44c4-4aae-a359-4be5bb09e33c@i7 6g2000hsf.googl egroups.com...
          On 22 Sep, 10:43, "James Hahn" <jh...@yahoo.co mwrote:
          >
          Thanks James,
          >
          did copy & run the code sample, its a useful learning sample for me
          but I did really want the visual effect of a drive list & folder list
          which give the user visual clues to where they are continually.
          >
          The project I was re-writing in Express was a very simple sound file
          player, just wanted the practice of writing it in .net but it seems
          too difficult unless I add com references to the project which sort of
          defeats the object.

          Comment

          • Marge

            #6
            Re: Drive List Box


            Thanks Kerry thats about as good as it going to get I guess. It seems
            VISUAL BASIC really as become much less VISUAL :o(

            The simple beauty of VB was the fact that you dragged a visual image
            of the control you wanted to use onto your form which then gave you
            coding clues, now it seems you have to do so much more in code with
            less visual help.

            The sample that James linked to shows how to search & open RTF files,
            this is a MS sample but it doesn't link or show how to do the same for
            any other file type I may want to do a similar thing with, why do they
            have to make everything so time consuming I seems to spend far to much
            time looking for examples than I do actually using VB?

            I need an EXCELLENT book or I think I best save my time :o(

            Comment

            Working...