Click here to Skip to main content
12,629,804 members (29,159 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C# ListBox
not sure how to write the code for this. i have two forms, one is the main form which has a listbox containing data which is loaded in from a text file. the other is a delivery form. when the user select an item in the list box and click the edit button, the delivery form should appear with the selected data displayed in the text box of the delivery form at the moment i have something like this

private Visit theVisit = new Visit();
private List<Delivery> deliveries = new List<Delivery>();
private FrmDelivery deliveryForm = new FrmDelivery();

private void updateDelivery()
{
lstDeliveries.Items.Clear();
List<String> listOfD = theVisit.listDeliveries();
lstDeliveries.Items.AddRange(listOfD.ToArray());
}
private void btnEditDelivery_Click(object sender, EventArgs e)
{
deliveryForm.ShowDialog();
updateDelivery();
}

		
Posted 27-Nov-12 14:18pm

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.161205.3 | Last Updated 27 Nov 2012
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100