Questions and Answers on any aspect of .NET. Now closed.
I have a file save dialog, and I'm trying to set the DefaultExt to be the last extension that the user saved a file as, to make saving multiple files easier.
It doesn't seem to work at all. I can set it to "txt" or ".txt", and even though the extension is in the filter string, they just don't take. It always selects the first extension in the list.
IIRC , the default extension string takes a special format of "<file extension description>|<file ext>" for example "text files|*.txt"
Thursday, November 08, 2007
The MSDN Library page for FileDialog.DefaultExt speaks thusly:
"By default, the AddExtension property attempts to determine the extension to filter the displayed file list from the Filter property. If the extension cannot be determined from the Filter property, DefaultExt will be used instead."
That sounds as if DefaultExt is simply ignored when a Filter element is already selected. Try setting FilterIndex instead, or along with DefaultExt.
Saturday, November 10, 2007
This topic is archived. No further replies will be accepted.Other recent topics
Powered by FogBugz