private void registerButton_Click(object sender, EventArgs e) { switch (authTypeComboBox.SelectedIndex) { case 0: StudentRegisterForm.ShowRegisterDialog(); break; case 1: TeacherRegisterForm.ShowRegisterDialog(); break; default: MessageBox.Show("请先选择身份", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); break; } }
/// <summary> /// 显示注册窗口 /// </summary> /// <returns>注册情况</returns> public static DialogResult ShowRegisterDialog() { using (var form = new StudentRegisterForm()) return(form.ShowDialog()); }