Reputation: 12192
another homework assignment here thats kind of unclear on the requirements. It is a forms program that assigns people to seats on an airplane. The part that is losing me is that its telling me to display the passenger manifest in a list box, but then its telling me to display it in a list box. Then it calls it a rich text box again. The screenshots provided with the assignment only show one display box. One of the events that is supposed to be included is a double click on an item in the manifest display. When the flight is closed, it tallies up your first class and business class passengers and displays that info in the same display box.
So my question is, was list box somehow incorporated into the rich text box? I thought maybe it was just overlayed, but later screenschots show the display box filled and scrolled down, as if it were all the same text box, rather than just a list box or rich text. I'm confused. Obviously, I'm not looking for anyone to do my work for me, but it doesn't appear this was covered in our material. Online class, so I don't get a lot of instructor feedback on stuff like this, unfortunately. Can anyone offer to shed any light on this?
Upvotes: 0
Views: 982
Reputation: 17002
Both controls support a double click event. However, the big clue here is "double click on an item in a list box." The control you want is a list box.
There's no restraint on the text in a list box, except that it can't really wrap (unless you're using WPF, in which case all bets are off). In both snapshots, the text is narrow enough that there's no horizontal scrollbar.
So the text you're seeing in the second example is just ListBox items that happen to look like they could have been rendered in a RichTextBox control using a Courier font. Notice the vertical scrollbar in that snapshot. It's because the ListBox has more items in it than the ListBox in the snapshot on the left.
Short answer: The mention of RichTextBox is, likely, a typographical error. But you'd do well to ask your instructor to clarify.
Upvotes: 1
Reputation: 3901
Based on the snapshot, I think you can achieve both of them using a ListBox, TextBox or a RichTextBox.
You can use a ListBox then when you click on Close Flight you show a RichTextBox. Just place the 2 controls on top of each other and set the Visible property to true or false based on the button you click, e.g. Start a New Flight makes the ListBox visible and the RichTextBox hidden.
Does this answer you question?
Upvotes: 0