![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Oct 2005
Location: The othe side
Posts: 19
Rep Power: 0
![]() |
OpenFileDialog Problems
I have this weired problem in that when my dialog comes up it shows no files in the directory. I have checked and there are 3 files in the directory, 1 txt file and 2 MDB files. If I select all files it shows all 3.
The Code I am using is: With OpenFileDialog1
.Filter = "Text Files (*.txt) | *.txt | E-Mails (*.eml) | *.eml | All Files (*.*) | *.*"
If OpenFileDialog1.ShowDialog() = DialogResult.OK Then
' Do something
End If
End WithCan any one spot the problem or offer some advise?
__________________
Cheers Ithaqua |
|
|
|
|
|
#2 |
|
Newbie
Join Date: Oct 2005
Location: The othe side
Posts: 19
Rep Power: 0
![]() |
Commenting out the filter line brings up the dialog in the right directory and it shows all 3 files.
![]()
__________________
Cheers Ithaqua |
|
|
|
|
|
#3 |
|
Newbie
Join Date: Oct 2005
Location: The othe side
Posts: 19
Rep Power: 0
![]() |
Sorted it out.
.Filter = "Text Files (*.txt) | *.txt | E-Mails (*.eml) | *.eml | All Files (*.*) | *.*" I had a extra space after the file extenstion. :mad: it should have been .Filter = "Text Files (*.txt) | *.txt| E-Mails (*.eml) | *.eml| All Files (*.*) | *.*" ![]()
__________________
Cheers Ithaqua |
|
|
|
|
|
#4 |
|
Expert Programmer
|
You're creating an array of atoms ready to be Split() using the | character. There should be no spaces either side of the pipes, unless you want to search for filenames starting or ending with a space (which you might), it was not a syntax error as such.
|
|
|
|
|
|
#5 |
|
Newbie
Join Date: Oct 2005
Location: The othe side
Posts: 19
Rep Power: 0
![]() |
Cheers
__________________
Cheers Ithaqua |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|