コード例 #1
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);
        }