I need this done in Visual Basic please include GUI if possible. Maintain a list
ID: 3773507 • Letter: I
Question
I need this done in Visual Basic please include GUI if possible.
Maintain a list of movie categories. Use a drop-down combo box to hold the movie types. keeping the list in alphabetic order. Use buttons or menu choices to Add a Category, Remove a Category, Clear All Categories, Print the Category List, Display the Movie Category Count, and Exit. Include appropriate access keys on your form and/or meny items.
Do not allow a blank type to be added to the list. Display an error message if the user selects Remove without first selecting a movie category. Before clearing the list, display a message box to confirm the operation.
The starting catefories are
Comedy
Drama
Action
Sci-Fi
Horror
Display the printed output in the Print Preview dialog box. Include your name and a heading at the top of the report.
Here is my design that I have so far.
Form File Edit About Video Bonanza Movie Categories Category List Print List Add a Category Exit Programmed by Jeremey CheserExplanation / Answer
Public Class Form1
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
End Sub
'sends the selected items to the list box
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
If ComboBox1.SelectedIndex > -1 Then
Dim sindex As Integer
sindex = ComboBox1.SelectedIndex
Dim sitem As Object
sitem = ComboBox1.SelectedItem
ListBox1.Items.Add(sitem)
End If
End Sub
'populates the list
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
ComboBox1.Items.Clear()
ComboBox1.Items.Add("Comedy")
ComboBox1.Items.Add("Drama")
ComboBox1.Items.Add("Action")
ComboBox1.Items.Add("Sci-Fi")
ComboBox1.Items.Add("Horror")
ComboBox1.Text = "Select from..."
End Sub
'sorting the list
Private Sub Button3_Click(sender As Object, e As EventArgs)
ComboBox1.Sorted = True
End Sub
'clears the list
Private Sub Button4_Click(sender As Object, e As EventArgs)
ComboBox1.Items.Clear()
End Sub
'displaying the selected item on the label
Private Sub ComboBox1_SelectedIndexChanged(sender As Object, e As EventArgs) _
Handles ListBox1.SelectedIndexChanged
Label1.Text = ComboBox1.SelectedItem.ToString()
End Sub
End Class
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.