Question

I have created Filter with this code:

saveFileDialog1.FileName = "SimplifiedLog";
saveFileDialog1.Filter = "RichTextFormate | *.rtf |Text Files | *.txt |All Files| *.*";
saveFileDialog1.Title = "Save Simplified KL File";
saveFileDialog1.ShowDialog();

The problem is that every time I select any filter (Other than the selected one) it adds extension in the previous one. See Picture below:Unwanted Filters

Était-ce utile?

La solution

You should remove the spaces:

saveFileDialog1.Filter = "RichTextFormate|*.rtf|Text Files|*.txt|All Files|*.*"; 

The spaces after and before | are evaluated as is, so you should not add them if not necessary.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top