Click here to Skip to main content
15,885,278 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: (untagged)
Hello, I've just started working with Visual Basic (roughly 3 months now) and I've seem to hit a snag.
The project at hand that I need to do is to make a Airplane Seating Chart program.
This is what my program looks like so far (design-wise):

http://i47.tinypic.com/jgs8rn.jpg

The criteria is: "An airplane has 15 rows (numbered 1 through 15), with six seats (labeled A, B, C, D, E, and F) in each row. Write a program to display the seating chart in a list box with a line for each row. When the ticket agent clicks on the desired row in the list box, the row number and the status of the seats in the row are displayed in seven read-only text boxes. When the agent clicks on one of the text boxes, a second form containing four option buttons labeled Unoccupied, Regular, Low Calorie, and Vegetarian appears. Clicking on any radio button closes the second form and updates both the text box and the row for that seat in the list box. Unoccupied seats should be denoted with a period, while occupied seats are denoted with the first letter of their meal type. At any time, the agent can request the number of seats filled, the number of window seats vacant, and the numbers of each type of meal ordered." So in the end, it should look like this:

http://i45.tinypic.com/jl457b.jpg

So far, my code is:

Public Class Form1
Dim meal As String
Dim rows(14, 5) As String
Dim seat1 As String, seat2 As String, seat3 As String, seat4 As String, seat5 As String, seat6 As
String
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
MyBase.Load
Dim column As String
seatSets.Items.Clear()
column = seatSets.Items.Add(" A B C D E F")
For rows As Integer = 0 To 14
seatSets.Items.Add(" . . . . . .")
Next
seatA.Items.Add(" . ")
seatB.Items.Add(" . ")
seatC.Items.Add(" . ")
seatD.Items.Add(" . ")
seatE.Items.Add(" . ")
seatF.Items.Add(" . ")
End Sub
Private Sub seatSets_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles seatSets.SelectedIndexChanged
Dim rowSelect As String
End Sub
Private Sub rowNum_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles rowNum.SelectedIndexChanged
End Sub
Private Sub seatA_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles seatA.SelectedIndexChanged
End Sub
Private Sub seatB_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles seatB.SelectedIndexChanged
End Sub


The problem that I can't seem to figure out is how I'm suppose to get seating chart (seatSets) to interact with the individual seat listboxes (ie. seatA, seatB and so on). That, and how to get the "frmMeal" in the final picture to interact with it all. ANY help would be greatly appreciated, as I'm bleeding my eyes out on the LCD, trying to figure this out! :omg: Looking forward to any and all replies---thanks! :)
Posted

1 solution

notso-slickrick wrote:
The problem that I can't seem to figure out is how I'm suppose to get seating chart (seatSets) to interact with the individual seat listboxes (ie. seatA, seatB and so on).


I'd imagine you'd iterate over the collection to set up your data as it needs to be set. seatA-seatF needs to exist in a collection, they exist 15 times. So, I think that part of your design is broken.

notso-slickrick wrote:
That, and how to get the "frmMeal" in the final picture to interact with it all.


If the form pops up, and then is closed ( is modal ), you can just pass data to it, and pull data from it as it closes. Otherwise, you can use delegates to communicate between forms,
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900