Created
June 3, 2014 16:49
-
-
Save xanathar/73faf20b3ecf062262c4 to your computer and use it in GitHub Desktop.
Quick reminder of WinForms standard file dialogs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
SaveFileDialog sfd = new SaveFileDialog(); | |
sfd.Title = "Save on XML"; | |
sfd.OverwritePrompt = true; | |
sfd.DefaultExt = "xml"; | |
sfd.Filter = "XML files (*.xml)|*.xml|All files (*.*)|*.*"; | |
if (sfd.ShowDialog() == DialogResult.OK) | |
{ | |
... | |
} | |
} | |
{ | |
OpenFileDialog sfd = new OpenFileDialog(); | |
sfd.Title = "Load from"; | |
sfd.DefaultExt = "xml"; | |
sfd.Filter = "XML files (*.xml)|*.xml|All files (*.*)|*.*"; | |
if (sfd.ShowDialog() == DialogResult.OK) | |
{ | |
... | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment