I need help with this airline seating program. All I need it to do for now is take the data from the second form (radio box), put it in the text box on the first form, and at the same time, have it update the listbox on that first form. Here is a screen of what the program looks like:
http://i21.photobucket.com/albums/b251/jfindon/program-1.jpg
And here is my code for the first form. I just can't get the listbox to update, I can get the textboxes filled with the data just fine.
Dim secondForm As New Form2
Private Sub lstSeats_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lstSeats.SelectedIndexChanged
Dim row As String = CStr(lstSeats.SelectedItem)
txtA.Text = row.Chars(0)
txtB.Text = row.Chars(1)
txtC.Text = row.Chars(2)
txtD.Text = row.Chars(4)
txtE.Text = row.Chars(5)
txtF.Text = row.Chars(6)
txtRow.Text = lstSeats.SelectedIndex + 1
End Sub
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
With lstSeats.Items
For rowNumber As Integer = 1 To 15
.Add("... ...")
Next rowNumber
End With
With lstStats.Items
.Add("Seats filled:")
.Add("Windows avail:")
.Add("Regular meals:")
.Add("LowCal meals:")
.Add("Veget meal:")
End With
End Sub
Private Sub txtA_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtA.Click
Dim row As String = CStr(lstSeats.SelectedItem)
secondForm.ShowDialog()
txtA.Text = secondForm.status = row
lstSeats.Items(lstSeats.SelectedIndex) = txtA.Text
End Sub
Private Sub txtB_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtB.Click
secondForm.ShowDialog()
txtB.Text = secondForm.status
End Sub
Private Sub txtC_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtC.Click
secondForm.ShowDialog()
txtC.Text = secondForm.status
End Sub
Private Sub txtD_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtD.Click
secondForm.ShowDialog()
txtD.Text = secondForm.status
End Sub
Private Sub txtE_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtE.Click
secondForm.ShowDialog()
txtE.Text = secondForm.status
End Sub
Private Sub txtF_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtF.Click
secondForm.ShowDialog()
txtF.Text = secondForm.status
End Sub
Private Sub btnDisplay_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDisplay.Click
lstStats.Visible = True
End Sub