Sams Teach Yourself Visual Basic 6 in 24 Hours

Sams Teach Yourself Visual Basic 6 in 24 Hours

By Greg Perry

Workshop

The quiz questions and exercises are provided for your further understanding. See Appendix B for the answers.

Quiz

  1. When do you normally initialize a list box?
  2. What method adds new items to a list box?
  3. Which method determines the number of items in a list box?
  4. True or false: Visual Basic will automatically keep list box items sorted if you set a certain property to True.
  5. How many combo boxes are there?
  6. How do you specify the type of combo box you want to add to an application?
  7. True or false: The drop-down list box is one of the Combo Box controls, so users can enter new values in the drop-down list box just as they can other Combo Box controls.
  8. What is an array?
  9. What is the highest subscript in a 10-element array if you don't use Option Base 1 and you use element 0?
  10. True or false: A control array exists when two or more controls have the same Name property.

Exercises

  1. Write an application that builds a list as the user enters new values. (Hint: Use a Combo Box control for the list.) The list should hold the user's favorite book titles. As the user enters more and more titles, the list should grow. Add a command button to the form with the caption Add To; when the user clicks the command button, the title just entered goes to the list. Keep the list sorted at all times.
  2. Write an application that contains four command buttons. The command buttons should be blue and have boldfaced, italicized captions that read Change Color, Change Bold, Change Height, and Change Width. When the user clicks one of the command buttons, the appropriate property should change inside the Click() event procedure. Use a Select Case statement to determine which property should change based on the event procedure's Index argument.

Share ThisShare This

Informit Network