Sams Teach Yourself Visual Basic 6 in 24 Hours
- Table of Contents
- Copyright
- About the Author
- Acknowledgments
- Introduction
- Who Should Read This Book
- What This Book Will Do for You
- Can This Book Really Teach Visual Basic in 24 Hours?
- What You Need
- Files on the Visual Basic Distribution CD-ROM
- Conventions Used in This Book
- Enough! Time Is Ticking!
- Part I: Introducing Visual Basic
- Hour 1. Visual Basic at Work
- Hour 2.Analyzing Visual Basic Programs
- Hour 3.Controls and Properties
- Hour 4.Examining Labels, Buttons, and Text Boxes
- Part II: Coding the Details
- Hour 5.Putting Code into Visual Basic
- Hour 6.Message and Input Boxes
- Hour 7.Making Decisions
- Hour 8.Visual Basic Looping
- Part III:Putting Code to Work
- Hour 9.Combining Code and Controls
- Hour 10.List Boxes and Data Lists
- Hour 11.Additional Controls
- Hour 12.Dialog Box Basics
- Part IV:Programming with Data
- Hour 13.Modular Programming
- Hour 14.Built-In Functions Save Time
- Hour 15.Visual Basic Database Basics
- Hour 16.Printing with Visual Basic
- Part V:Sprucing Up Programs
- Hour 17.Menus and Visual Basic
- Hour 18.The Graphic Image Controls
- Hour 19.Toolbars and More Graphics
- Hour 20.Writing Correct Applications
- Part VI:Advancing Visual Basic Applications
- Hour 21.Visual Basic and ActiveX
- Hour 22.Object Basics
- Hour 23.Distributing Your Applications
- Hour 24.Online Visual Basic
- Part VII:Appendixes
- Appendix A.Operator Precedence
- Appendix B.Answers
- Appendix C.Using the CD-ROM
Workshop
The quiz questions and exercises are provided for your further understanding. See Appendix B for the answers.
Quiz
- True or false: Option button captions always appear to the right of the buttons.
- What happens if the user clicks an option button that isn't currently selected?
- Why would you gray out a Check Box control?
- What happens if the user clicks a check box that isn't currently selected?
- True or false: An application can begin with none of its option buttons or check boxes selected.
- What kind of control can you place on a frame?
- What is the difference between a scrollbar's SmallChange and LargeChange properties?
- Which property changes when the user clicks one of the scrollbar's arrows?
- True or false: The Timer control works like an alarm clock ready to go off at a preset time of day.
- True or false: If you need a timer interval greater than approximately 10 seconds, you must use multiple Timer controls.
Exercises
- Create an application that mimics the frame application used with Listing 11.1. Instead of using separate option buttons, use an option button array for each frame's option button, making a total of three option button arrays. Change Listing 11.1 to reduce the number of event procedures in the application. Use a Select Case statement based on the event procedure Index argument to set the appropriate label property.
- Change the application you wrote in exercise 1 so that no frames appear on the form. Remove the Underline and Italic option buttons (keep the Framed Color option buttons) and add these check box controls in their place: Underline and Italic. Change the code so that the text will appear underlined if the user clicks the Underline check box, and the text will be italicized if the user clicks the Italic check box. Both or only one might be checked at any one time.
- Duplicate this lesson's scrollbar application that lets the user set the label's text size with the scrollbar. Completely remove the scrollbar, however, and add a Timer property. Every second, add 5 to the label's font size. When the font size grows to 70 or more points, send the size back down to 8 and start increasing the size once again.
Hour 12.Dialog Box Basics | Next Section

Account Sign In
View your cart