Form Object

This object is a window or dialog box that constitutes part of an application’s user interface.

Syntax

Form

The Form object supports the following properties:

ActiveControl FontTransparent
Appearance FontUnderline
AutoRedraw ForeColor
BackColor HDC
BorderStyle Height
Caption HWnd
ClipControls KeyPreview
Controls Left
CurrentX Moveable
CurrentY Name
DrawMode ScaleHeight
DrawStyle ScaleLeft
DrawWidth ScaleMode
Enabled ScaleTop
FillColor ScaleWidth
FillStyle ShowInTaskBar
Font StartUpPosition
FontBold Tag
FontItalic Top
FontName Visible
FontSize Width
FontStrikethru WindowState

The Form object supports the following methods:

Cls SetScale
DrawCircle ScaleX
DrawLine ScaleY
Hide SetFocus
Move Show
Point TextHeight
PointSet TextWidth
Refresh ZOrder

The Form object supports the following events:

Activate LostFocus
Click MouseDown
DblClick MouseMove
Deactivate MouseUp
GotFocus Paint
KeyDown QueryUnload
KeyPress Resize
KeyUp Terminate
Load  

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 also can respond to events initiated by a user or generated by the system. For example, you can write code in a form's Click event procedure that enables the user to change the color of a form by choosing it.

In addition to properties and events, you can use methods to manipulate forms using code. For example, the Move method changes 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.

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.