방문 용 및 픽업 용 중 하나 사용자가 방문 또는 픽업 중 하나를 목록에 추가하면 목록 상자에 추가되어 사용자에게 표시됩니다.ListBox, 인덱스 변경 선택
제 질문은 Indexchanged와 같은 목록 상자 안의 항목을 클릭했을 때 Visits 또는 Delivery 's와 관련된 새로운 GUI를 열어보고 싶습니다. 방문을 클릭하면 다음과 같은 방문 양식이 열립니다. 내 코드에서 볼 수 있듯이, 어떻게 열 수있는 양식을 알 수 있도록 목록을 구별 할 수 있습니까?
편집 : 두 목록에서 항목이 같은리스트 박스에 저장되어있는 경우
private void lstVisits_SelectedIndexChanged(object sender, EventArgs e)
{
//Allow the user to click on the listbox to open a visit
//This event is called after the user has clicked on the list
int index = lstVisits.SelectedIndex;
//Get the index of the Visit that the user has clicked upon
Visits selected = theList.getVisits(index);
//Get the visits object from the list
Visitsform.visits = selected;
//Ensure that the appointment form references the selected visit
Visitsform.ShowDialog();
//Show the visits form
updateList();
//update the list as the user may have deleted the appointment
방문 및 배달은 어디에 저장됩니까? 당신은 두 개의 listBoxes 방문에 대한 하나와 배달원에 대한 하나 또는 둘 다 동일한 listBox에 추가됩니까? –
두 개의 서로 다른 목록이 있습니다. 하나는 방문 목록 용 List.cs 클래스이고 다른 하나는 pickuplist.cs라는 하나의 클래스로, 배달 목록을 저장하는 하나의 클래스이며 모두 하나의 목록 상자에 추가됩니다. – TAM
'theList' 란 무엇입니까? 그리고 어떤 메소드'getVisits (index)'가합니까? –