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 selects an item in the list box and clicks 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();
}