You are here:About>Computing & Technology>Visual Basic> Learn VB.NET> Working With Menus and Dialog Boxes - Part 3
About.comVisual Basic
Newsletters & RSSEmail to a friendSubmit to Digg

Chapter 4 - Working With Menus and Dialog Boxes - Part 3

From Dan Mabbutt,
Your Guide to Visual Basic.
FREE Newsletter. Sign Up Now!

Music Trivia - Here's one way to write a more complete Music Trivia program

Yay
Previous | Next >>

Let's review.

Music Trivia is a really simple program from Chapter 1 in the book that is supposedto present music trivia questions and then display the correct answer. But when we peeked at the code for the Music Trivia program, we discovered that there was just one question!

What kind of trivia contest is that?

So ... using the techniques we learned in the rest of Part 1 of the book ... well ... stretchingthose techniques a little ... it's possible to write a much more complete program.

To refresh your memory, here's the assignment from lesson 4:

  1. Think of at least three music trivia questions you can use and then add the components and program logic to present them randomly to the user of the program.
  2. Display three possible answers for each question and use radio buttons to allow one of the answers to be selected.
  3. Write the program code for a button to determine if the correct answer is selected. Display the graphic of your choice (or a label) to indicate correct and incorrect answers.
  4. Display a "Play Again?" button and a "Quit" button after each round of question and answer and write the code to implement each choice.

There are a lot of 'correct' ways to write this program and the one I have written is not necessarily the best way to go about it. If your solution is different, well ... maybe your solution is just better than mine.

The complete form code for my solution starts on the next page.

  1. Music Trivia - Here's one way to write a more complete Music Trivia program
  2. The Music Trivia Solution Code - Page 1
  3. The Music Trivia Solution Code - Page 2
  4. The Music Trivia Solution Code - Page 3
  5. The Music Trivia Solution Code - Page 4
  6. Notes about the Solution Code - Page 1
  7. Notes about the Solution Code - Page 2
  8. Notes about the Solution Code - Page 3
  9. Notes about the Solution Code - Page 4
  10. Notes about the Solution Code - Page 5

Previous | Next >>

 All Topics | Email Article | | |
Advertising Info | News & Events | Work at About | SiteMap | Reprints | HelpOur Story | Be a Guide
User Agreement | Ethics Policy | Patent Info. | Privacy Policy©2008 About, Inc., A part of The New York Times Company. All rights reserved.