Example #1
0
        private void PictureBox_Click(object sender, EventArgs e)
        {
            PictureBox picClicked = (PictureBox)sender;
            int        cardPos    = Panel1.Controls.IndexOf(picClicked);

            int cardPos2 = Panel2.Controls.IndexOf(picClicked);

            if (cardPos != -1)
            {
                hand1.RemoveCard((Card)picClicked.Tag);
                ShowHand(Panel1, hand1);
            }
            else if (cardPos2 != -1)
            {
                hand2.RemoveCard((Card)picClicked.Tag);
                ShowHand(Panel2, hand2);
            }
            else
            {
                hand3.RemoveCard((Card)picClicked.Tag);
                ShowHand(Panel3, hand3);
            }
        }