private string SaveFileName() { // save file dialog box SaveFileDialog Dialog = new SaveFileDialog(); Dialog.AddExtension = true; Dialog.Filter = QRCode.FileFilter((ImageFormat)ImageFormatComboBox.SelectedItem); Dialog.Title = "Save QR Code Image"; Dialog.InitialDirectory = Directory.GetCurrentDirectory(); Dialog.RestoreDirectory = true; Dialog.FileName = string.Format("QRCode{0}{1}.{2}", QRCode.QRCodeVersion, QRCode.ErrorCorrection.ToString(), ((ImageFormat)ImageFormatComboBox.SelectedItem).ToString().ToLower()); if (Dialog.ShowDialog() == DialogResult.OK) { return(Dialog.FileName); } return(null); }