When you call
saveFileDialog.ShowDialog()
it returns DialogResult, not the selected file name. The SaveCopyAs method expects a file name.
Check out the SaveFileDialog tutorial here to learn how to get the selected file name. It should be something like:
private void Form1_DoubleClick(object sender, System.EventArgs e) { if( this.saveFileDialog1.ShowDialog() == DialogResult.OK ) { MessageBox.Show("The Save button was clicked or the Enter key was pressed" + "\nThe file would have been saved as " + this.saveFileDialog1.FileName); } else MessageBox.Show("The Cancel button was clicked or Esc was pressed"); }
source share