X 유형 목록이 있습니다. X는 속성 레벨 클래스입니다. 이벤트에서 다른 목록에 CheckedListBox Selected Items가 필요합니다.CheckedListBox 선택한 항목을 목록으로 가져 오는 방법 <X> ...?
출력을 얻는 방법 ... ?? 내가 아래에 주어진 시도 코드 ...
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...???
}
웹 프로젝트인가? Windows 응용 프로그램? –
Windows 응용 프로그램 친구 ... –
[목록 상자에서 일반 목록으로 항목 모음 전송] (http://stackoverflow.com/questions/471595/casting-an-item-collection-from-a-listbox) 이 잘 작동 -to-A-일반적인 목록) –