How can I stop a System.Windows.Forms.SaveFileDialog
from prompting twice to replace a selected file, and instead prompt only once?
Either I'm missing something, there's something wrong with my install, or the default behaviour is just dumb.
var saveFileDialog = new SaveFileDialog();
saveFileDialog.ShowDialog();
// User selects file and clicks "Save" within the dialog
I'm not doing anything special at all, this is in an empty Windows Forms project, targeting .NET Framework 4.7.2.
Edit: Added full Program.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace WindowsFormsApp1
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
var saveFileDialog = new SaveFileDialog();
saveFileDialog.ShowDialog();
}
}
}