private void tb_GameName_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter && !string.IsNullOrEmpty(this.tb_GameName.Text)) { CreateGameClicked?.Invoke(this, e); } }
private void btn_CreateGame_Click(object sender, EventArgs e) { if (!string.IsNullOrEmpty(this.tb_GameName.Text)) { CreateGameClicked?.Invoke(this, e); } else { this.tb_GameName.Focus(); this.tb_GameName.BackColor = Color.LightPink; } }