Sunday, January 10, 2021

[VB.net][example] vb.net open file browser multiselect

 vb.net open file browser multiselect

Dim ofd As OpenFileDialog = New OpenFileDialog()

Dim ofdFileName As String

ofd.Title = "Open File Dialog"

ofd.InitialDirectory = "C:\"

ofd.Filter = "All files(*.*)|*.*"

ofd.FilterIndex=2

ofd.RestoreDirectory=True

ofd.Multiselect = True


If ofd.ShowDialog() == DialogResult.OK Then

  For Each mFile As String In fd.FileNames

    Debug.WriteLine(mFile)

  Next

EndIf

Result:

C:\1.txt

C:\2.jpg

C:\3.txt


Reference:

https://stackoverflow.com/questions/32288216/select-multiple-files-and-load-the-file-names-to-checked-list-box

No comments :

Post a Comment