Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. Visual Basic
  4. can i select multiple files?

can i select multiple files?

Scheduled Pinned Locked Moved Visual Basic
helpquestion
7 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    noshaba mariam
    wrote on last edited by
    #1

    I'm trying to attach some files. For this I'm using Show Open common dialogue control. But with this I could only be able to open/select one file at a time. Is there any property of common dialogue control with which i could be able to select multiple files at a time by pressing shift key. my code is as follows Private Sub fOpen_Click() cdlg1.CancelError = True On Error GoTo ErrHandler cdlg1.filename = "" cdlg1.DialogTitle = "Open Image File" cdlg1.Filter = "Image File(*.jpeg,*.jpg)|*.jpeg;*.jpg" cdlg1.FilterIndex = 1 cdlg1.ShowOpen ErrHandler: Exit Sub End Sub Noshaba Mariam

    A 1 Reply Last reply
    0
    • N noshaba mariam

      I'm trying to attach some files. For this I'm using Show Open common dialogue control. But with this I could only be able to open/select one file at a time. Is there any property of common dialogue control with which i could be able to select multiple files at a time by pressing shift key. my code is as follows Private Sub fOpen_Click() cdlg1.CancelError = True On Error GoTo ErrHandler cdlg1.filename = "" cdlg1.DialogTitle = "Open Image File" cdlg1.Filter = "Image File(*.jpeg,*.jpg)|*.jpeg;*.jpg" cdlg1.FilterIndex = 1 cdlg1.ShowOpen ErrHandler: Exit Sub End Sub Noshaba Mariam

      A Offline
      A Offline
      alien viper
      wrote on last edited by
      #2

      Set cdlg1.Multiselect = True !alien!

      N 1 Reply Last reply
      0
      • A alien viper

        Set cdlg1.Multiselect = True !alien!

        N Offline
        N Offline
        noshaba mariam
        wrote on last edited by
        #3

        if i use this, following error encounters Method or Data Member not found

        A 1 Reply Last reply
        0
        • N noshaba mariam

          if i use this, following error encounters Method or Data Member not found

          A Offline
          A Offline
          alien viper
          wrote on last edited by
          #4

          'I am using VB.NET Not VB 6 Dim op As New OpenFileDialog op.Multiselect = True If op.ShowDialog(Me) = DialogResult.OK Then Dim files() As String=op.FileNames End If !alien!

          N 1 Reply Last reply
          0
          • A alien viper

            'I am using VB.NET Not VB 6 Dim op As New OpenFileDialog op.Multiselect = True If op.ShowDialog(Me) = DialogResult.OK Then Dim files() As String=op.FileNames End If !alien!

            N Offline
            N Offline
            noshaba mariam
            wrote on last edited by
            #5

            oh sorry it was by mistake that i didn't mentioned that i'm using vb 6 :( sorry

            D 1 Reply Last reply
            0
            • N noshaba mariam

              oh sorry it was by mistake that i didn't mentioned that i'm using vb 6 :( sorry

              D Offline
              D Offline
              Dave Kreskowiak
              wrote on last edited by
              #6

              VB6, huh? OK. It's almost as easy, but surely not obvious how to do it. You have to set the Flags property of the CommonDialog before you show it.

              Private Sub fOpen_Click()
              cdlg1.CancelError = True
              On Error GoTo ErrHandler
              cdlg1.filename = ""
              cdlg1.DialogTitle = "Open Image File"
              cdlg1.Filter = "Image File(*.jpeg,*.jpg)|*.jpeg;*.jpg"
              cdlg1.FilterIndex = 1
              cdlg1.Flags = &H200
              cdlg1.ShowOpen
              ErrHandler:
              Exit Sub
              End Sub

              You can find more information about that, and other options, here[^]. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome -- modified at 13:28 Monday 27th February, 2006

              N 1 Reply Last reply
              0
              • D Dave Kreskowiak

                VB6, huh? OK. It's almost as easy, but surely not obvious how to do it. You have to set the Flags property of the CommonDialog before you show it.

                Private Sub fOpen_Click()
                cdlg1.CancelError = True
                On Error GoTo ErrHandler
                cdlg1.filename = ""
                cdlg1.DialogTitle = "Open Image File"
                cdlg1.Filter = "Image File(*.jpeg,*.jpg)|*.jpeg;*.jpg"
                cdlg1.FilterIndex = 1
                cdlg1.Flags = &H200
                cdlg1.ShowOpen
                ErrHandler:
                Exit Sub
                End Sub

                You can find more information about that, and other options, here[^]. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome -- modified at 13:28 Monday 27th February, 2006

                N Offline
                N Offline
                noshaba mariam
                wrote on last edited by
                #7

                Thnx Dave u have solved my problem it really works :) Noshaba

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups