winforms - C# dynamically delete checkboxes -
I am trying to delete a check box from a group box by pressing a button. After this I want to put the remaining checkboxes in order.
Private Zero Button 2_Click (Object Sender, EventArgs e) {for (Ii = 0; i & lt; =) Number_ch; i ++) {foreach (control C. control in group box 2.) {if (c.getetpe (.name == "checkbox") {if (((checkbox) c). == true} {groupBox2 .Controls.Remove (C); Number_ch--; }}}}} This works fine but how do I keep the rest in sequence?
You should not delete the control, visible = false !
Comments
Post a Comment