private void BtnOK_Click(object sender, EventArgs e) { if (tbNewPath.Text.Length > 0) { if (Owner is FrmBatch f) { if (tbNewPath.Text != "Normal") { f.DefaultTemplate = FileUtilities.ConvertFilePathToUri(tbNewPath.Text); } else { f.DefaultTemplate = "Normal"; } } else if (Owner is FrmMain fm) { if (tbNewPath.Text != "Normal") { fm.DefaultTemplate = FileUtilities.ConvertFilePathToUri(tbNewPath.Text); } else { fm.DefaultTemplate = "Normal"; } } } Close(); }