public void AddPanels() { for (int i = 0; i < 25; i++) { for (int j = 0; j < 15; j++) { var currentPanel = new TetrisPanel(); currentPanel.IsFix = false; currentPanel.Width = 20; currentPanel.Height = 20; currentPanel.BackColor = Color.Black; currentPanel.Margin = new Padding(1); ToolTip toolTip1 = new ToolTip(); toolTip1.AutoPopDelay = 5000; toolTip1.InitialDelay = 1000; toolTip1.ReshowDelay = 500; toolTip1.ShowAlways = true; // Set up the ToolTip text for the Button and Checkbox. toolTip1.SetToolTip(currentPanel, i + ":" + j); panelArray[i, j] = currentPanel; //i = x und j = y tableLayoutPanel1.Controls.Add(panelArray[i, j]); } } for (int a = 0; a < 2; a++) { for (int b = 0; b < 4; b++) { var currentPanel = new TetrisPanel(); currentPanel.IsFix = false; currentPanel.Width = 20; currentPanel.Height = 20; currentPanel.BackColor = Color.Black; currentPanel.Margin = new Padding(1); ToolTip toolTip2 = new ToolTip(); toolTip2.AutoPopDelay = 5000; toolTip2.InitialDelay = 1000; toolTip2.ReshowDelay = 500; toolTip2.ShowAlways = true; toolTip2.SetToolTip(currentPanel, a + ":" + b); panelArrayVorschau[a, b] = currentPanel; tableLayoutPanelVorschau.Controls.Add(panelArrayVorschau[a, b]); } } }