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. True or false: A selected control (the control with its sizing handles showing) is the control with the focus.
  2. True or false: When the user clicks the mouse over a control in a window that doesn't have the focus, the clicked control still gets the focus.
  3. Which control works better for titles: labels or text boxes?
  4. What can you do to close a Form window when the user presses Esc?
  5. Which property disables a text box from triggering events when the user types or clicks the text box?
  6. Why do you think labels fail to support a GetFocus event?
  7. What happens if you set a label's AutoSize property to True before setting the WordWrap property to True if the label holds a long caption value?
  8. Why should you avoid adding too many autosizing labels to the form at one time?

Exercises

  1. Write a Visual Basic application that displays an appropriate form title and asks the user for his first and last names in two separate text boxes. Add a command button that terminates the program when the user clicks the command button, presses the command button's hotkey, or presses Esc.
  2. Create an application with five command buttons. Reverse the focus order so that when you run the application and press the Tab key several times, the focus order flows upward through the command buttons.
  3. Write an application that displays three labels with the same long label Caption property in each. Don't display the entire caption in the first label. Display the caption horizontally in the second label. Display the caption vertically down the window in the third label. You may have to expand the Form window to its full size (perhaps by setting the Form window's WindowState property to 2-Maximized).

Share ThisShare This

Informit Network