设置OverwritePrompt 属性为false,然后在FileOK中写自己的提示,并取消保存:
SaveFileDialog dialog = new SaveFileDialog(); dialog.OverwritePrompt = false; dialog.FileOk += (sender, e) => { if (System.IO.File.Exists(dialog.FileName)) { MessageBox.Show("no,no,no"); e.Cancel = true; } }; dialog.ShowDialog(); dialog.Dispose();