//Method to determine the number of active players and show the correct textboxes and labels public void DetermineNumberOfPlayers() { int numberOfPlayers = dal.game.playerList.Count(); if (numberOfPlayers >= 1) { player1NameLabel.Text = dal.game.playerList[0].GetName(); BetPlayer1TextBox.Text = dal.game.playerList[0].GetBet().ToString(); scorePlayer1TextBox.Text = "Score: " + dal.game.playerList[0].GetValueOfHand().ToString(); player1NameLabel.Show(); BetPlayer1TextBox.Show(); scorePlayer1TextBox.Show(); BetPlayer1TextBox.Enabled = false; scorePlayer1TextBox.Enabled = false; } if (numberOfPlayers >= 2) { player2LabelName.Text = dal.game.playerList[1].GetName(); BetPlayer2TextBox.Text = dal.game.playerList[1].GetBet().ToString(); scorePlayer2TextBox.Text = "Score: " + dal.game.playerList[1].GetValueOfHand().ToString(); player2LabelName.Show(); BetPlayer2TextBox.Show(); scorePlayer2TextBox.Show(); BetPlayer2TextBox.Enabled = false; scorePlayer2TextBox.Enabled = false; } if (numberOfPlayers >= 3) { player3LabelName.Text = dal.game.playerList[2].GetName(); BetPlayer3TextBox.Text = dal.game.playerList[2].GetBet().ToString(); scorePlayer3TextBox.Text = "Score: " + dal.game.playerList[2].GetValueOfHand().ToString(); player3LabelName.Show(); BetPlayer3TextBox.Show(); scorePlayer3TextBox.Show(); BetPlayer3TextBox.Enabled = false; scorePlayer3TextBox.Enabled = false; } if (numberOfPlayers >= 4) { player4LabelName.Text = dal.game.playerList[3].GetName(); BetPlayer4TextBox.Text = dal.game.playerList[3].GetBet().ToString(); scorePlayer4TextBox.Text = "Score: " + dal.game.playerList[3].GetValueOfHand().ToString(); player4LabelName.Show(); BetPlayer4TextBox.Show(); scorePlayer4TextBox.Show(); BetPlayer4TextBox.Enabled = false; scorePlayer4TextBox.Enabled = false; } if (numberOfPlayers >= 5) { player5LabelName.Text = dal.game.playerList[4].GetName(); BetPlayer5TextBox.Text = dal.game.playerList[4].GetBet().ToString(); scorePlayer5TextBox.Text = "Score: " + dal.game.playerList[4].GetValueOfHand().ToString(); player5LabelName.Show(); BetPlayer5TextBox.Show(); scorePlayer5TextBox.Show(); BetPlayer5TextBox.Enabled = false; scorePlayer5TextBox.Enabled = false; } }