private void generateLabels() { PictureBoxWithText firstLabelPlayer = new PictureBoxWithText(Properties.Resources.WoodenForLabel, String.Format("Player 1: {0}", m_Board.CurrentPlayer.PlayerName)); PictureBoxWithText secondLaberlPlayer = new PictureBoxWithText(Properties.Resources.WoodenForLabel, String.Format("Player 2: {0}", m_Board.OtherPlayer.PlayerName)); firstLabelPlayer.Location = new Point(70, 20); secondLaberlPlayer.Location = new Point(ClientSize.Width - 250, 20); this.Controls.Add(firstLabelPlayer); this.Controls.Add(secondLaberlPlayer); }
private void updateScoreInsideLabels() { Control[] firstPlayerLabel, secondPlayerLabel; firstPlayerLabel = this.Controls.Find(k_LabelNameOfFirstPlayer, false); secondPlayerLabel = this.Controls.Find(k_LabelNameOfSecondPlayer, false); PictureBoxWithText firstLabel = firstPlayerLabel[0] as PictureBoxWithText; PictureBoxWithText secondLabel = secondPlayerLabel[0] as PictureBoxWithText; firstLabel.setNewTextInsidePicture(String.Format("{0} - {1}", CheckerboardController.Instance.CurrentPlayer.PlayerName, CheckerboardController.Instance.CurrentPlayer.Score)); secondLabel.setNewTextInsidePicture(String.Format("{0} - {1}", CheckerboardController.Instance.OtherPlayer.PlayerName, CheckerboardController.Instance.OtherPlayer.Score)); }
private void generateLabelsOfPlayersName() { PictureBoxWithText firstLabelPlayer = new PictureBoxWithText(Properties.Resources.WoodenForLabel, String.Format("{0} - {1}", CheckerboardController.Instance.CurrentPlayer.PlayerName, CheckerboardController.Instance.CurrentPlayer.Score)); PictureBoxWithText secondLaberlPlayer = new PictureBoxWithText(Properties.Resources.WoodenForLabel, String.Format("{0} - {1}", CheckerboardController.Instance.OtherPlayer.PlayerName, CheckerboardController.Instance.OtherPlayer.Score)); firstLabelPlayer.Location = new Point(70, 0); firstLabelPlayer.Name = k_LabelNameOfFirstPlayer; secondLaberlPlayer.Location = new Point(ClientSize.Width - 250, 0); secondLaberlPlayer.Name = k_LabelNameOfSecondPlayer; this.Controls.Add(firstLabelPlayer); this.Controls.Add(secondLaberlPlayer); }