Пример #1
0
        private void azap(Patnashki a)
        {
            for (int i = 0; i < 3; i++)
            {
                a.Table[3, i] = Int32.Parse(table[3, i].Text);

                for (int j = 0; j < 4; j++)
                {
                    a.Table[i, j] = Int32.Parse(table[i, j].Text);
                }
            }
            a.Table[3, 3] = 0;
            for (int i = 0; i < 3; i++)
            {
                for (int j = 0; j < 4; j++)
                {
                    a.createButton(table[i, j], this, size, size, table[i, j].Text, table[i, j].Left, table[i, j].Top, Event_MouseClick, table[i, j].Name, table[i, j].Margin);
                }
            }
            for (int j = 0; j < 3; j++)
            {
                a.createButton(table[3, j], this, size, size, table[3, j].Text, table[3, j].Left, table[3, j].Top, Event_MouseClick, table[3, j].Name, table[3, j].Margin);
            }
            a.I = 3;
            a.J = 3;
        }
Пример #2
0
        private void zap(Patnashki a)
        {
            table[0, 0]        = new Button();
            table[0, 0].Left   = x;
            table[0, 0].Top    = y;
            table[0, 0].Text   = a.Table[0, 0].ToString();
            table[0, 0].Margin = new Padding(0);

            for (int i = 1; i < 4; i++)
            {
                table[i, 0]        = new Button();
                table[i, 0].Top    = table[i - 1, 0].Top + size;
                table[i, 0].Left   = table[0, 0].Left;
                table[i, 0].Text   = a.Table[i, 0].ToString();
                table[i, 0].Margin = new Padding(0);


                table[0, i]        = new Button();
                table[0, i].Top    = table[0, 0].Top;
                table[0, i].Left   = table[0, i - 1].Left + size;
                table[0, i].Text   = a.Table[0, i].ToString();
                table[0, i].Margin = new Padding(0);


                for (int j = 1; j < 4; j++)
                {
                    table[i, j]        = new Button();
                    table[i, j].Text   = a.Table[i, j].ToString();
                    table[i, j].Left   = size + table[i, j - 1].Left;
                    table[i, j].Top    = table[i, 0].Top;
                    table[i, j].Margin = new Padding();
                }
            }
            for (int i = 0; i < 3; i++)
            {
                for (int j = 0; j < 4; j++)
                {
                    a.createButton(table[i, j], this, size, size, table[i, j].Text, table[i, j].Left, table[i, j].Top, Event_MouseClick, table[i, j].Name, table[i, j].Margin);
                }
            }
            for (int j = 0; j < 3; j++)
            {
                a.createButton(table[3, j], this, size, size, table[3, j].Text, table[3, j].Left, table[3, j].Top, Event_MouseClick, table[3, j].Name, table[3, j].Margin);
            }
        }