1
Answer

In C# (or in C# with WPF), how would I build a checkbox at run time?


In C# (or in C# with WPF), how would I build a checkbox at run time? I would I be able to query the check box to see if the user clicked on it?
In other words, suppose I have a "grid" on which I want to have displayed some checkboxes. But I do not know how many checkboxes to display. I suppose I could (in WPF) fill the grid with checkboxes at design time and mark them as hidden (or visibly == false) and then show them at run time. But I was hoping there was a more elegant way to do this.
Answers (1)
0
Mahesh Chand
2 286.9k 123.7m 14y

Here are both ways. Look for part where articles talk about dynamic creation of CheckBoxes.
 
WPF CheckBox
CheckBox in C#