I've just determined, by experimenting, that regardless of its Filter and
DefaultExt properties, a SaveFileDialog will let you save the file with
*any* registered extension.
For instance, if you specify a SaveFileDialog with the attributes:
AddExtension = true
Filter = "Foo files|*.foo"
DefaultExt = "foo"
and you type the file name qwerty, you get qwerty.foo, exactly as you might
expect.
And if you type qwerty.bla (where .bla is not a registered extension), you
get qwerty.bla.foo. Again so far so good.
But if you type the file name qwerty.exe, or qwerty.bat, or qwerty.doc, or
any other file name with a registered extension, then .foo is *not* appended
to it.
This does not strike me as entirely wise, and I haven't found any
documentation of it!
Is there another attribute that will disable it (so my file dialog will
really insist on file names ending in .foo)?
Thanks!
Michael A. Covington - Artificial Intelligence Ctr - University of Georgia
"In the core C# language it is simply not possible to have an uninitialized
variable, a 'dangling' pointer, or an expression that indexes an array
beyond its bounds. Whole categories of bugs that routinely plague C and C++
programs are thus eliminated." - A. Hejlsberg, The C# Programming Language