samedi 17 juin 2017

Checking all the Checkboxes in a certain row by giving the row number in C#

I have Created Checkboxes like this but now i want to be able to check all the Checkboxes in one Row after giving the Row number

    private void button4_Click(object sender, EventArgs e)
    {

        CheckBox[,] c = new CheckBox[10, 5];
        for (i = 1; i < c.GetLength(0); i++)
        {

            for ( j = 1; j < c.GetLength(1); j++)
            {
                c[i, j] = new CheckBox();
                c[i, j].Location = new Point(i * 50, j * 50);

                c[i, j].AutoSize = true;

                c[i, j].Name = i + "-" + j.ToString();
                c[i, j].Text = i + "-" + j.ToString();
                this.Controls.Add(c[i, j]);


            }

        }




Aucun commentaire:

Enregistrer un commentaire