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. Why must you open the project's Components dialog box before using the Toolbar control?
  2. Which control works with the toolbar to produce icon images on the buttons?
  3. What does the Image control's Key method do?
  4. Why does the toolbar's event procedure use an argument?
  5. How many shapes can the Shape control produce?
  6. Which property determines the pattern of drawn lines?
  7. True or false: You should use the LoadPicture() function to initialize or change the value displayed with the Shape control.
  8. What is the FillStyle property used for?
  9. True or false: You can change a shape's interior and exterior color.

Exercises

  1. Write an application that includes a large Shape control (originally placed as a square) in the middle of the form. Add a command button that reads Change Shape. Every time the user clicks the command button, change the shape to something different.
  2. Create a Form window that contains a rectangle with a blue border, red diagonal lines, and a green interior.
  3. Write an application that draws a yellow happy face in the center of the form. Don't use a graphic image file. Add two toolbar buttons, one with a happy face icon from an icon file and one with a sad face icon. When the user clicks the happy face toolbar button, wink the happy face's eye. When the user clicks the sad face toolbar button, draw a tear coming out of one eye.

Share ThisShare This

Informit Network