private void btnChooseServer_Click(object sender, EventArgs e) { frmChooseServer frmChooseServer = new frmChooseServer(); OverlayForm overlayForm = new OverlayForm(this, frmChooseServer, setChild: false); frmChooseServer.Show(); }
private void txtRunnerTeacher_Click(object sender, EventArgs e) { string currentTeacher = ((sender as MaterialTextBox).Text.Length > 0) ? (sender as MaterialTextBox).Text : null; frmChooseTeacher frmChooseTeacher = new frmChooseTeacher((sender as MaterialTextBox).Tag.ToString(), (sender as MaterialTextBox).Hint, currentTeacher); OverlayForm overlay = new OverlayForm(this, frmChooseTeacher, 0.40f, setChild: false); frmChooseTeacher.FormClosed += (s, e) => { if (frmChooseTeacher.chosenTeacherID.Length > 0) { (sender as MaterialTextBox).Text = frmChooseTeacher.chosenTeacherID; } }; frmChooseTeacher.Show(); }