Create a Windows Forms application using Visual Studio 2010 via New -> Project -> C# Windows Forms Application. Give it the name Quiz5.

Create the following on your main form:

  • A TextBox called txtItemToAdd.
  • A Button called btnAdd with text "Add Item" on it.
  • A ListBox called lbItems with MultiSimple selection mode.
  • A Button called btnDelete with text "Delete Item(s)" on it.

Do the following with what you’ve created:

  • Create an Event Handler for the btnAdd clicked event that does the following:
    • Takes the text value from txtItemToAdd and Validates it using the ValidateItem method.
    • If validated add the text value as a new item in the lbItems list Items collection.
  • Create an Event Handler for the btnDelete clicked event that does the following:
    • Goes through every item in the lbItems ListBox and removes it if it is selected.
  • Create a ValidateItem() method that does the following:
    • Takes a string parameter and returns a Boolean.
    • Ensures the string parameter is not an empty string or return false.
    • Goes through the lbItems, Items collection and makes sure that the string parameter does not match any of the string items there already, return false if it does.
    • Otherwise, return true.
Academic Honesty!
It is not our intention to break the school's academic policy. Projects posted are only used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly fill out the form. Please provide a valid email address and we'll get back to you in less than 24 hours. We will be sending an invoice through PayPal upon confirmation. We are a non profit organization however we need an amount to keep this organization running, and to be able to complete our research and development.