KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I'm sorry if this seems n00bish, but I have been searching for this for a few days now. I am attempting to dynamically add checkboxes to a windows form; however, only one checkbox appears on the form. Here is my code: for (int i = 0; i < 10; i++) { box = new CheckBox(); box.Tag = i.ToString(); box.Text = "a"; box.AutoSize = true; box.Location = new Point(10, i + 10); Main.Controls.Add(box); } As you can see I am adding the checkboxes via a for loop. I have tried messing with the location and enabling autosize in case they were somehow overlapping. The result is a single checkbox with text "a".
Tags (comma-separated)
Save Edits
Cancel