private CardButton CreateCardButton(CardFace f1, CardFace f2, bool suited)
        {
            CardButton button = new CardButton();

            button.HoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
            button.Selected = false;
            button.SelectedColor = System.Drawing.Color.Yellow;
            button.Size = new System.Drawing.Size(BUTTON_SIZE, BUTTON_SIZE);
            button.TabIndex = 0;

            String value;
            if (suited) value = HoldemHand.ConvertToString(f1, CardSuit.Clubs, f2, CardSuit.Clubs);
            else value = HoldemHand.ConvertToString(f1, CardSuit.Clubs, f2, CardSuit.Diamonds);

            button.Name = "btn" + value;
            button.Value = value;

            return button;
        }
Beispiel #2
0
        private CardButton CreateCardButton(CardFace face, CardSuit suit)
        {
            CardButton button = new CardButton();

            button.HoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
            button.Selected = false;
            button.SelectedColor = System.Drawing.Color.Yellow;
            button.Size = new System.Drawing.Size(BUTTON_SIZE, BUTTON_SIZE);
            button.TabIndex = 0;

            // Make sure the suit is lower cased
            String value = Card.CardFaceToChar(face) + new String(Card.CardSuitToChar(suit), 1).ToLower();
            button.Name = "btn" + value;
            button.Value = value;
            button.Click += new EventHandler(button_Click);

            return button;
        }