Getting data from File List boxes


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: Getting data from File List boxes

  1. #1
    Don Fuller Guest

    Getting data from File List boxes


    Hello,

    I am having trouble getting info from my file list box. I am working on a
    file comparison tool, I am not able to get the filename into the compare
    dialog. I have no problem getting the drive and directory names/path, just
    not the filename. I have double click and OK button events working fine but
    not with the file name, the path stops at the directory level.

    Also, is there an easy way to get file size info? I have attribute and date/time
    but I can't find any documentation on getting the file size.

    Thanks,

    Don

  2. #2
    Craig Brown Guest

    Re: Getting data from File List boxes


    Don,

    Are you setting the file list box path property when the directory changes?

    Private Sub dirDirectoryList_Change()

    filFileList.Path = dirDirectoryList.Path

    End Sub

    Check out FileLen function to get the size of your file.

    Craig Brown


    "Don Fuller" <ponchrelo@hotmail.com> wrote:
    >
    >Hello,
    >
    >I am having trouble getting info from my file list box. I am working on

    a
    >file comparison tool, I am not able to get the filename into the compare
    >dialog. I have no problem getting the drive and directory names/path, just
    >not the filename. I have double click and OK button events working fine

    but
    >not with the file name, the path stops at the directory level.
    >
    >Also, is there an easy way to get file size info? I have attribute and date/time
    >but I can't find any documentation on getting the file size.
    >
    >Thanks,
    >
    >Don



  3. #3
    Bob Rouse Guest

    Re: Getting data from File List boxes


    Don,
    For the file names: This is a simple way to get them:

    For X = 0 to file1.ListCount - 1
    strFileName = file1.List(X)
    ' Do something here...
    Next

    Note that the file name will not be the complete path. If you need a fully-qualified
    filename then use:

    file1.Path & "\" & file1.List(X)

    I apologize in advance if I am talking way under your level...

    "Craig Brown" <brownc3@ing-afs.com> wrote:
    >
    >Don,
    >
    >Are you setting the file list box path property when the directory changes?
    >
    >Private Sub dirDirectoryList_Change()
    >
    >filFileList.Path = dirDirectoryList.Path
    >
    >End Sub
    >
    >Check out FileLen function to get the size of your file.
    >
    >Craig Brown
    >
    >
    >"Don Fuller" <ponchrelo@hotmail.com> wrote:
    >>
    >>Hello,
    >>
    >>I am having trouble getting info from my file list box. I am working on

    >a
    >>file comparison tool, I am not able to get the filename into the compare
    >>dialog. I have no problem getting the drive and directory names/path, just
    >>not the filename. I have double click and OK button events working fine

    >but
    >>not with the file name, the path stops at the directory level.
    >>
    >>Also, is there an easy way to get file size info? I have attribute and

    date/time
    >>but I can't find any documentation on getting the file size.
    >>
    >>Thanks,
    >>
    >>Don

    >



  4. #4
    Dean Earley Guest

    Re: Getting data from File List boxes

    You could use the filename property

    --
    Dean Earley (dean.earley@icode.co.uk)
    Assistant Developer

    iCode Systems
    "Don Fuller" <ponchrelo@hotmail.com> wrote in message news:3abbaae5$1@news.devx.com...
    >
    > Hello,
    >
    > I am having trouble getting info from my file list box. I am working on a
    > file comparison tool, I am not able to get the filename into the compare
    > dialog. I have no problem getting the drive and directory names/path, just
    > not the filename. I have double click and OK button events working fine but
    > not with the file name, the path stops at the directory level.
    >
    > Also, is there an easy way to get file size info? I have attribute and date/time
    > but I can't find any documentation on getting the file size.
    >
    > Thanks,
    >
    > Don




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center