Possible Duplicate:
CheckBox inside ListBox
How to insert a check box inside a list box in C#?
I would like to add check-boxes inside a list-box, in windows from application.
Here is my code:
CheckBox cb = new CheckBox();
while (dr.Read())
{
listBox1.Items.Add(String.Format("{0} {1}",cb,dr["Stu_Name"]));
}
However, it is not producing intended result.
What i want is a check-box before each column value from the data reader? Any suggestions?
In short: You need to use the CheckedListBox Control (Windows Forms).
Here is a sample code for Windows forms application: