Results 1 to 7 of 7

Thread: [RESOLVED] CommonDialog Control Multi Select

  1. #1

    Thread Starter
    Member SgtSlayer's Avatar
    Join Date
    Aug 2005
    Posts
    46

    Resolved [RESOLVED] CommonDialog Control Multi Select

    Hello

    How can I make it so my commondialog control can select multiple files in the showopen window?

    Thanks SgtSlayer

  2. #2

  3. #3
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: CommonDialog Control Multi Select

    You need to use this other flag if you want Long Filename support.

    VB Code:
    1. CommonDialog1.Flags = cdlOFNAllowMultiselect Or cdlOFNLongNames

  4. #4

    Thread Starter
    Member SgtSlayer's Avatar
    Join Date
    Aug 2005
    Posts
    46

    Re: CommonDialog Control Multi Select

    That Rocks! Is there any way I can change the interface for that thou?

    Thanks
    SgtSlayer

  5. #5
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: CommonDialog Control Multi Select

    I'm not sure what you mean, but here's the routine that I use:
    VB Code:
    1. Private Sub cmdOpen_Click()
    2.   ' CancelError is True.
    3.    On Error GoTo ErrHandler
    4.    ' Set Flags
    5.     CommonDialog1.Flags = cdlOFNAllowMultiselect Or cdlOFNLongNames
    6.    ' Set filters.
    7.    CommonDialog1.Filter = "All Files (*.*)|*.*|Text" & _
    8.       "Files (*.txt)|*.txt|Batch Files (*.bat)|*.bat"
    9.    ' Specify default filter.
    10.    CommonDialog1.FilterIndex = 2 ' Picks TEXT as default
    11.    ' Display the Open dialog box.
    12.    CommonDialog1.ShowOpen
    13.    ' Call the open file procedure.
    14.  '  OpenFile (CommonDialog1.FileName)
    15.    Exit Sub
    16.  
    17. ErrHandler:
    18. ' User pressed Cancel button.
    19.    Exit Sub
    20.  
    21. End Sub

    Filename returns this, you'd have to split() on the space between names.
    D:\VISUAL~2\C\CDCSHO~1\ CDCSHO~1.ZIP form1.frm form1.frx Project1.vbp Project1.vbw
    Last edited by dglienna; Sep 5th, 2005 at 04:12 PM.

  6. #6
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758

    Re: CommonDialog Control Multi Select

    Is there any way I can change the interface for that thou?
    There are two basic interfaces to the ShowOpen method. The one shown depends on the inclusion of the cdlOFNExplorer flag.

    CommonDialog1.Flags = cdlOFNAllowMultiselect Or cdlOFNLongNames Or cdlOFNExplorer

    There are other flags that let you manipulate the interface

    cdlOFNHelpButton - adds a Help button
    cdlOFNHideReadOnly - hide the "Open as ReadOnly" checkbox.

  7. #7

    Thread Starter
    Member SgtSlayer's Avatar
    Join Date
    Aug 2005
    Posts
    46

    Re: CommonDialog Control Multi Select

    Ok Thanks!

    Thanks
    SgtSlayer

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width