// TODO filter currently open form or close and open a new one? private void surveyEntryToolStripMenuItem_Click(object sender, EventArgs e) { if (CurrentSurvey == null) { return; } if (frmParent.GetTab("Survey Entry") == null) { SurveyEntry frm = new SurveyEntry(CurrentSurvey.SurveyCode); frmParent.AddTab(frm, "Survey Entry", "SurveyEntry"); } else { SurveyEntry frm = (SurveyEntry)frmParent.GetTab("Survey Entry").Controls["Survey Entry"]; frmParent.FocusTab("Survey Entry"); } }
private void cmdOpenSurveyEntry_Click(object sender, EventArgs e) { if (GetTab("Survey Entry") != null) { tabControl1.SelectTab("Survey Entry"); return; } string surveyFilter = currentUser.SurveyEntryCodes[0]; SurveyEntry frm = new SurveyEntry(surveyFilter); frm.frmParent = this; frm.key = "Survey Entry"; frm.index = 1; try { AddTab(frm, "Survey Entry", "Survey Entry"); tabControl1.TabPages[frm.key].Text = "Entry - " + surveyFilter; } catch { } }