Example #1
0
        public void createButton(string board, int number, PartidaForm form, bool opponentBoard, int startVerticalPosition, int startHorizontalPosition)
        {
            btn = new Button();

            btn.Height   = heightField;
            btn.Width    = widthFields;
            btn.Name     = board + "btn" + number.ToString();
            btn.Location = new Point(startHorizontalPosition, startVerticalPosition);

            setImage();

            if (opponentBoard)
            {
                btn.Click += new EventHandler(form.btn_Mina_Click);
            }

            if (opponentBoard)
            {
                form.getGroupBox_OponnentShips().Controls.Add(btn);
            }
            else
            {
                form.getGroupBox_YourShips().Controls.Add(btn);
            }
        }