Form

A Form object is a window or dialog box that makes up part of an application's user interface.

Syntax

Form

The Form object properties, methods, and events listed in the following table are supported:

Properties Methods Events
ActiveControl Cls Activate
Appearance DrawCircle Click
AutoRedraw DrawLine DblClick
BackColor Hide Deactivate
BorderStyle Move GotFocus
Caption Point KeyDown, KeyUp
ClipControls PointSet KeyPress
Controls Refresh Load
CurrentX SetScale LostFocus
CurrentY ScaleX MouseDown, MouseUp
DrawMode ScaleY MouseMove
DrawStyle SetFocus Paint
DrawWidth Show QueryUnload
Enabled TextHeight Resize
FillColor TextWidth Terminate
FillStyle ZOrder
Font
FontBold
FontItalic
FontName
FontSize
FontStrikethru
FontTransparent
FontUnderline
ForeColor
HDC
Height
HWnd
KeyPreview
Left
Moveable
Name
ScaleHeight
ScaleLeft
ScaleMode
ScaleTop
ScaleWidth
ShowInTaskBar
StartUpPosition
Tag
Top
Visible
Width
WindowState

Remarks

Forms have properties that determine aspects of their appearance, such as position, size, and color; and aspects of their behavior, such as whether or not they are resizable.

Forms can also respond to events initiated by a user or triggered by the system. For example, you could write code in a form's Click event procedure that would enable the user to change the color of a form by clicking it.

In addition to properties and events, you can use methods to manipulate forms using code. For example, you can use the Move method to change a form's location and size.

When designing forms, set the BorderStyle property to define a form's border, and set the Caption property to put text in the title bar. In code, you can use the Hide and Show methods to make forms invisible or visible at run-time.

Note Setting BorderStyle to 0 removes the border. If you want your form to have a border without the title bar or Control-menu box, delete any text from the form's Caption property and set the form's ControlBox properties to False.