private string SaveFileAs(FaTabStripItem f) { using (var sfd = new SaveFileDialog { Title = string.Format(@"Select the filename to save {0} as...", f.Title) }) { sfd.Filter = FileFilters.GetFilters(); sfd.FileName = Path.GetFileNameWithoutExtension(f.Title); sfd.FilterIndex = FileFilters.GetExtensionIndex(string.Format("*{0}", Path.GetExtension(f.Title))); if (sfd.ShowDialog(_tabStrip.Parent) == DialogResult.Cancel) { return(string.Empty); } var fileName = sfd.FileName; f.Tag = fileName; System.Diagnostics.Debug.Print(fileName); return(fileName); } }