OpenFileDialog .... Help plz

Encrypted-w

Member
Joined
Mar 1, 2011
Messages
17
Programming Experience
Beginner
Hi all
Firstly, I am weak in English :(
I would like to help me plz
I want get the file names specified in the OpenFileDialog
I've used Multiselect in OpenFileDialog
And Thank u
 
Let us assume that OFD is the name of your OpenFileDialogue. Replace OFD with the name as appropriate.
First you need to show the dialogue.

VB.NET:
OFD.ShowDialog()
Once that is closed you have to check and process each name
VB.NET:
for each n in OFD.FileNames ' works through each Filename that has been selected.
msgbox(n) ' displays the file name in a message box. You should replace this with your own code.
Next n ' goes onto the next filename
 
Thank u very mush
It is true
But why open the window twice ?
--------------------------------
With OFD
.CheckFileExists = True
.ShowReadOnly = False
.Filter = "JPG|*.jpg|Bitmap|*.bmp"
.FilterIndex = 1
.Multiselect = True
If .ShowDialog = DialogResult.OK Then
OFD.ShowDialog()
For Each n In OFD.FileNames ' works through each Filename that has been selected.
ListBox1.Items.Add(n) ' displays the file name in a message box. You should replace this with your own code.
Next n ' goes onto the next filename
End If
End With
 
If you're using that code and in particular have that if statment, you don't need the ODF.ShowDialogue() line. Remove that line and it'll only open once.
 
:eek: ... I still Beginner
Thank you very much for help me
icon14.png
 
Back
Top