samedi 10 juin 2017

How to create Checkboxex in Vertical and Horizinal

Like thisHow can i creat checkboxes dynamically in Vertical and horizontal

 private void button1_Click_1(object sender, EventArgs e)
    {
        CheckBox[] c = new CheckBox[10];
 for (int i = 0; i < c.Length; i++)
        {
            for (int j = 1; j < c.Length; j++)
            {
                c[i] = new CheckBox();
                c[j] = new CheckBox();

                c[i].Location = new Point(5, i * 20);
                c[j].Location = new Point(j * 20, 20);
                this.Controls.Add(c[i]);
                this.Controls.Add(c[j]);
            }
        }




Aucun commentaire:

Enregistrer un commentaire