Possible array solution
Posted on 2005-05-04
I have a form which has three textboxes (txtAircraftID,txtCarrierName, and txtFuelCharges). and a listbox lstAircraftId. What I need to have happen is once the user fills the textboxes and the menu is clicked the AircraftID appears in the listbox, once the text boxes are cleared and the aircraftID is highlighted in the listbox the aircraftID and the other entered text reappears in the proper textbox. I can get the aircraftID to appear in the textbox, and I can get the AircraftID to reappear in it's textbox but not the other entered text. I was hoping someone could help me with an array to accomplish this. Here is the code for the menu and the listbox.
Private Sub mmuRecordSaveArrival_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mmuRecordSaveArrival.Click
Dim newitemtext As String = txtAircraftID.Text
Private Sub AircraftID_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lstAircraftID.SelectedIndexChanged
Dim sAircraftID As String = lstAircraftID.SelectedItem.ToString()
txtAircraftID.Text = lstAircraftID.SelectedItem.ToString
I think an array is the solution but I don't know exactly how to code it.