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
Form Properties
Forms have properties that you can and should set when you create an application. As the background of your application, the form's properties help set the stage for the rest of the project. The form supports more property values than the other controls described in this lesson, but Table 4.4 lists only the most common properties you'll need.
Pixel stands for picture element and represents the smallest addressable graphic dot on your monitor.
Table 4.4. Common form properties.
| Property | Description |
| BackColor | Specifies the form's background color. Click the BackColor's palette down arrow to see a list of colors and click System to see a list of common Windows control colors. |
| BorderStyle | Determines how the Form window appears. The BorderStyle property specifies whether the user can resize the form and also determines the kind of form you want to display. |
| Caption | Displays text on the form's title bar at runtime. |
| ControlBox | Determines whether the form appears with the Control menu icon. The Control menu appears when your application's user clicks the Control menu icon. |
| Enabled | Determines whether the form is active. Often, you'll change the Enabled property at runtime with code when a form is no longer needed. Generally, only multiform applications such as MDI applications need to modify a form's Enabled property. |
| Font | Produces a Font dialog box in which you can set the text's font name, style, and size. |
| ForeColor | Holds the color of the form's text. |
| Height | Holds the height of the form's outline in twips. |
| Icon | Describes the icon graphic image displayed on the taskbar when the user minimizes the form. |
| Left | Holds the number of twips from the form's left edge to the screen's left edge. |
| MaxButton | Specifies whether a maximize window button appears on the form. |
| MinButton | Specifies whether a minimize window button appears on the form. |
| MousePointer | Determines the shape of the mouse cursor when the user moves the mouse over the form. |
| Moveable | Specifies whether the user can move the form at runtime. |
| Picture | Determines a graphic image that appears on the form's background at runtime. |
| ScaleMode | Determines whether the form's measurements appear in twips, pixels (the smallest graphic dot image possible), inches, centimeters, or other measurements. |
| ShowInTaskbar | Determines whether the form appears on the Windows taskbar. |
| StartUpPosition | Determines the state (centered or default) of the form at application startup. |
| Top | Holds the number of twips from the form's top edge to the Form window's top edge. |
| Visible | Determines whether the form appears or is hidden from the user. |
| Width | Holds the width of the form in twips. |
| WindowState | Determines the initial state (minimized, maximized, or normal) in which the window appears at runtime. |
Summary | Next Section

Account Sign In
View your cart