Forums - C# Corner

Forum guidelines
Vishal Deb

Vishal Deb

  • 1.3k
  • 2
  • 2.2k

How to know dynamically created chekboxes is selected or not

May 8 2013 9:40 AM
Hi All

I am trying to generated the dynamic labels depending on the checked checkboxes which are dynamically created.

My .Net frame is 3.5
Here is code for dynamic checkboxes

System.Windows.Forms.CheckBox[] checkBox = new System.Windows.Forms.CheckBox[bran_count];

            for (int i = 0; i < bran_count; ++i)
                checkBox[i] = new CheckBox();
                checkBox[i].Name = "radio" + Convert.ToString(i);
                checkBox[i].Text = ds2.Tables[0].Rows[i][2].ToString();
                checkBox[i].Location = new System.Drawing.Point(125 * i, 15);
                checkBox[i].CheckStateChanged += new System.EventHandler(CheckBoxCheckedChanged);
        private void CheckBoxCheckedChanged(object sender, EventArgs e)
Any guidance is welcome, if possible give some code snippet.

Answers (1)

Unlimited Flat-Free License


File APIs for .NET
Aspose are the market leader of .NET APIs for file business formats – natively work with DOCX, XLSX, PPT, PDF, MSG, MPP, images formats and many more!