Sams Teach Yourself Visual Basic 6 in 24 Hours

Sams Teach Yourself Visual Basic 6 in 24 Hours

By Greg Perry

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.

Share ThisShare This

Informit Network