private void generateCards() { int height = m_Board.Cards.GetLength(0); int width = m_Board.Cards.GetLength(1); for (int i = 0; i < height; i++) { for (int j = 0; j < width; j++) { ButtonCard <Image> buttonCard = new ButtonCard <Image>(i, j, m_Board.Cards[i, j]); buttonCard.Location = new Point(i * (buttonCard.Width + k_Space), j * (buttonCard.Height + k_Space)); buttonCard.Click += cardButton_Click; Controls.Add(buttonCard); buttonCard.CardSelection += paintCard; m_CardButtons.Add(buttonCard); } } ClientSize = new Size(m_Board.Cards.GetLength(0) * (k_Size + k_Space), (m_Board.Cards.GetLength(1) * (k_Size + k_Space)) + 100); }
private void paintCard(ButtonCard <Image> buttonCard) { buttonCard.BackColor = m_PlayingUserInterfacePlayer.Color; }