Beispiel #1
0
        public override Button MakeButton(Form1 form1, int posX, int posY)
        {
            ReadyTab.readTab();
            Button button = new Button();

            button.Location  = new Point(posX, posY);
            button.Size      = new Size(sizeX, sizeY);
            button.BackColor = Color.Beige;
            button.Text      = ReadyTab.getNumber();
            button.Click    += ItemOnClick.ButtonOnClick;
            form1.Controls.Add(button);
            return(button);
        }
Beispiel #2
0
        public void makeTable(Form1 f1)
        {
            for (int i = 0, slizeY = 0; i < tabSizeY; i++)
            {
                if (i % 3 == 0)
                {
                    ItemFactory.CreateItem(f1, 0, i * ButtonBase.sizeY + slizeY, WhatItem.MyLabelY);
                    slizeY += 3;
                }
                if (i == 8)
                {
                    ItemFactory.CreateItem(f1, 0, (i + 1) * ButtonBase.sizeY + slizeY, WhatItem.MyLabelY);
                }
                for (int j = 0, slizeX = 0; j < tabSizeX; j++)
                {
                    if (j % 3 == 0)
                    {
                        ItemFactory.CreateItem(f1, j * ButtonBase.sizeX + slizeX, 0, WhatItem.MyLabelX);
                        slizeX += 3;
                    }
                    if (j == 8)
                    {
                        ItemFactory.CreateItem(f1, (j + 1) * ButtonBase.sizeX + slizeX, 0, WhatItem.MyLabelX);
                    }


                    if (ReadyTab.getNumber() == " ")
                    {
                        ItemFactory.CreateItem(f1, j * ButtonBase.sizeX + slizeX, i * ButtonBase.sizeY + slizeY, WhatItem.NormalButton);
                    }
                    else
                    {
                        ItemFactory.CreateItem(f1, j * ButtonBase.sizeX + slizeX, i * ButtonBase.sizeY + slizeY, WhatItem.ReadOnlyButton);
                    }
                    ReadyTab.licz++;
                }
            }
            ItemFactory.CreateItem(f1, 300, 300, WhatItem.CheckButton);
        }