我有一个 X 类型的列表。X 是一个属性级别类。现在在一个事件中,我需要将 CheckedListBox 选定项目放入另一个列表中。
如何获得输出......?我试过的代码如下...
public void Initialize(List<X> x1)
{
chkList.DataSource = x1;
chkList.DisplayMember = "MeterName"; // MeterName is a property in Class X
chkList.ValueMember = "PortNum"; // PortNum is a property in Class X
}
private void Click_Event(object sender, EventArgs e)
{
List<X> x2 = new List<X>();
// Here I want to get the checkedListBox selected items in x2;
// How to get it...???
}