/// <summary> /// 用户名输入框的焦点失去事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void text_manager_username_Leave(object sender, EventArgs e) { if (text_manager_username.Text != "") { if (mb.FindUserName(text_manager_username.Text).Count == 0) { lab_prompt.Text = "该用户名可以使用"; lab_prompt.ForeColor = Color.Green; } else { lab_prompt.Text = "该用户名已被使用"; lab_prompt.ForeColor = Color.Red; } } }