Is it necessary to have the "All files" option in the dialogBox. I tried removing it but it won't compile. gives some sort of error

this.saveFileDialog1.Filter =
"Document Files - (*.txt)|*.txt|" +
"All files (*.*)|*.*";

Tried removing the [+ "All file ] onwards string.

this.saveFileDialog1.Filter =
"Document Files - (*.txt)|*.txt|";

gives the same prob. with openFileDialoag.

Recommended Answers

All 2 Replies

Tried it with saveFileDialog1.Filter = "doc files (*.txt)|*.txt"; without problems.

thanks, just figured it out. was placing an extra char "|" after *.txt

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.