I'm relatively new to winforms programming, coming from ASP.NET, and I'm struggling to bundle things like the "Enabled" field from the checklistbox.items list.
For example, I have:
class A
{
public string Name {get;set;}
public bool Enabled {get; set;}
}
Then I create the elements of list A and snap to the marked list.
List<A> aList = new List<A>(
new A{Name="Item1", Enabled=true},
new A{Name="Item2", Enabled=false} );
CheckedListBox.DataSource = aList;
CheckedListBox.DisplayMember = "Name";
Finally, how do I make elements with "Enabled == false" to show how disabled in the list of marks?
Of course, I will need to do the same with the checked property, but for simplicity I do not add it to the example.
Thank,
John
source
share