public Form1() { InitializeComponent(); MasterMindBoard mmBoard = new MasterMindBoard(); MasterMindSecretBoard mmSecret = new MasterMindSecretBoard(); MasterMindCheckBoard mmCheck = new MasterMindCheckBoard(); for (int i = 0; i < 10; i++) { for (int k = 0; k < 2; k++) { for (int l = 0; l < 2; l++) { AddCheckingButton(mmCheck, i, k, l); } } AddRound(i); for (int j = 0; j < 4; j++) { AddControl(mmBoard, i, j); AddSecretFields(mmSecret, j); } } }
public void AddControl(MasterMindBoard mmBoard, int i, int j) { Field mmButton = new Field(); mmButton.Location = new Point(Btn_Orange.Location.X + mmBoard.Board[i, j].XCoordinate, Btn_Orange.Location.Y - mmBoard.Board[i, j].YCoordinate - 61); mmButton.Size = new Size(Btn_Orange.Size.Width, Btn_Orange.Size.Height); mmButton.AllowDrop = true; mmButton.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; Controls.Add(mmButton); //mmButton.Text = "["+(i).ToString()+"," + (j).ToString()+"]"; // ROBOCZO - poźniej wykomentować mmButton.ForeColor = Color.Black; mmButton.DragEnter += MmButton_DragEnter; mmButton.DragDrop += MmButton_DragDrop; }