I am making a DTO creator. I am able get the table names and put them into datatable. The problem is, I must create checkboxes dynamically using these table names, and then be able to get whatever items checked. This is what I have been able to come up with so far:
for (int i = 0; i < dtable.Rows.Count; i++)
{
string cbName = dtable.Rows[i][0].ToString();
//Console.WriteLine(dtable.Rows[i][0]);
CheckBox box = new CheckBox();
box.Tag = i.ToString();
box.Text = cbName;
box.AutoSize = true;
box.Location = new Point(10, i * 50); //vertical
//box.Location = new Point(i * 50, 10); //horizontal
this.Controls.Add(box);
}
The dtable already has names and I create the checkboxes. However they are out the rendered area of the form, can see at most 10 of them. Also, how can I register which boxes are checked during runtime?
Controlsand get each value? Many ways that can be achieved.