/// <summary> /// Method for updating each Guy's radio button with his name and amount of cash. /// Also updates the Guy's bet description, if he has placed a bet and MyBet is not null. /// </summary> public void UpdateLabels() { MyRadioButton.Text = Name + " has " + Cash + " bucks"; if (MyBet != null) { MyLabel.Text = MyBet.GetDescription(); //MyBet.GetDescription() returns a string with the bet description. } }
public void UpdateLabels() { MyRadioButton.Text = Name + " has " + Cash.ToString() + " bucks"; if (MyBet != null && MyBet.Amount > 0) { MyLabel.Text = MyBet.GetDescription(); } else { MyLabel.Text = Name + " hasn't placed a bet."; } }
public Label MyLabel; //MyLabel public void UpdateLabels() { if (MyBet == null) { MyLabel.Text = Name + " hasn't placed a bet"; } else { MyLabel.Text = MyBet.GetDescription(); } MyRadioButton.Text = Name + " has " + Cash + " bucks"; }
public void UpdateLabel() { // Set my label to my bet's description, and the label on my // radio button to show my cash ("Joe has 43 bucks") if (MyBet != null) { MyLabel.Text = MyBet.GetDescription(); } else { MyLabel.Text = Name + " hasn't placed a bet"; } MyRadioButton.Text = Name + " has " + Cash + " bucks"; }
//Update labels on form, depends if a bet has been placed or not. public void UpdateLabels() { //set my label to my bets desc if (MyBet != null) { MyLabel.Text = MyBet.GetDescription(); //radio button to show my cash ("Joe has 43 bucks") MyRadioButton.Text = Name + " has " + (Cash - MyBet.Amount).ToString() + " bucks"; } else { MyLabel.Text = Name + " hasn't placed a bet"; //radio button to show my cash ("Joe has 43 bucks") MyRadioButton.Text = Name + " has " + Cash.ToString() + " bucks"; } }
public void UpdateLabels() { _myLabel.Text = _myBet.GetDescription(); _myRadioButton.Text = $"{_name} has {_cash} bucks."; }
//my method to update the guys' labels public void UpdateLabels() { MyBet.Bettor = this; MyLabel.Text = MyBet.GetDescription(); MyRadioButton.Text = Name + " has $" + Cash; }
public void UpdateLabels() { MyRadioButton.Text = Name + " has " + Cash + " bucks"; MyLabel.Text = Name + " " + MyBet.GetDescription(); }