vendredi 31 mars 2017

Add checkbox button

I'm creating list view with checkboxes, and I need in this a button that adds next checkbox in my form app. I know how to add single box, but idk how to make a loop that will helps me to add next checkboxes. Here, I give u a piece of code. At the start I have 24 checkboxes, next must be on 612 px position.

private void btnAdd_Click(object sender, EventArgs e)
    {
         CheckBox box;
         box = new CheckBox();
         box.AutoSize = true;
         box.Location = new Point(30, 612);
         this.Controls.Add(box);
    }




Aucun commentaire:

Enregistrer un commentaire