private void btnNext_Click(object sender, EventArgs e) { clearLayout(); if (!string.IsNullOrWhiteSpace(txtNumAttr.Text)) { numOfAttributes = Int32.Parse(txtNumAttr.Text); if (numOfAttributes <= 30) { for (int i = 0; i < numOfAttributes; i++) { fillControlList(i); FlowLayoutPanel flowLayout = ControlManager .CreateLayout(new FlowLayoutPanel(), FlowDirection.LeftToRight, listControls); flowLayoutPanel.Controls.Add(flowLayout); } isCorrect = new bool[numOfAttributes]; btnNext.Enabled = false; } else { MessageBox.Show("Maximum number of properties is 30."); } } }