Form
Object List Hierarchy Next Object
Definition:
A form is a defined area on which you can place other objects to create part
of an application’s interface. A form contains application code and can be used to create
windows, dialog boxes, and message boxes that are necessary in most programs.
Specialized Features:
The following tables list and describe the properties, methods, and events
that are added by Form:
Property Use to...
AccelForm Forward menu accelerator keypresses to another form.
BevelInner Determine how the inner border is drawn.
BevelOuter Determine how the outer border is drawn.
BevelWidth Set or return the size of the bevel style for both BevelInner and BevelOuter.
BorderWidth Set or return the space between the two bevels.
BorderStyle Determine the type of border to be used.
CancelButton Reference the CancelButton object, which allows a user to select the
designated button by pressing ESC.
ClientHWnd Determine the hWnd of the form's client area.
Controls Access all the controls on a form.
ControlBox Determine if the ControlBox icon will be displayed/disabled on the form.
CurrentX Determine the horizontal coordinate on a form at which the next drawing or
printing method will begin.
CurrentY Determine the vertical coordinate on a form at which the next drawing or
printing method will begin.
DefaultButton Reference the DefaultButton object, which allows a button to be selected by
pressing ENTER.
DrawColor Control the line color of drawing methods that use a pen.
DrawMode Control how drawing operations affect drawable objects.
DrawStyle Control the line style of drawing methods that use a pen.
DrawWidth Control the line thickness of drawing methods that use a pen.
FileDrop Permit or deny files from being dragged onto a form.
FillColor Determine the color used to fill the inside of items that are drawn using a
brush.
FillStyle Determine the pattern used to fill the inside area of items drawn using a
brush.
hDC Provide a Handle Device Context of an object.
KeyPreview Determine which events are invoked first, form keyboard events or control
keyboard events.
MaxButton Determine whether the Maximize button will be displayed on the form.
MinButton Determine whether the Minimize button will be displayed on the form.
MenuBar Assign a MenuBar object to a Form.
Outlined Include a black border line around the outside of the object.
ScaleHeight Determine the internal vertical measurement of a form.
ScaleLeft Determine the horizontal coordinate for the left edge of a form.
ScaleMode Specify the standard unit of measurement to be used for coordinates of a form.
ScaleTop Determine the vertical coordinate for the top edge of a form.
ScaleWidth Determine the internal horizontal measurement of a form.
ShownModal Determine whether a form was shown with the ShowModal method, and has not been
resolved
Method Use to...
AngleArc Draw an elliptical arc using the current pen.
Arc Draw a line segment and an arc.
BringToTop Force a Form to appear on top of any other Forms.
Center Center a form on the screen.
Chord Draw a chord.
Cls Remove any drawn images on the Form.
DetailedEdit Bring up a form for providing additional information when an object is double
clicked in the Property Editor or when a control on a form is double clicked
while the Form Editor is on.
Ellipse Draw an ellipse or circle.
Hide Remove an active, visible form from the screen but do not remove it from
memory.
LineTo Draw a line from CurrentX, CurrentY to user-specified coordinates.
LoadForm Specify and additional code to execute when a Form is loaded.
Maximize Cause a Form to occupy the entire desktop.
Minimize Cause the Form to “minimize” into a icon on the bottom of the desktop.
ModalResult Return a result to the code that showed the Form from a call to ShowModal
MoveTo Update CurrentX, CurrentY with the specified coordinates.
Pie Draw a v-shaped wedge.
PolyBezier Draw one or more bezier splines.
Polygon Draw a polygon that is filled and automatically closed.
Polyline Draw line segments in a series. The lines are not filled or closed.
Print Print the specified text on a form using the current color, font, and point
size.
Rectangle Draw a rectangle using the given coordinates.
RoundRect Draw a rectangle with rounded corners using the given coordinates.
Scale Define the coordinate system using a scale of your choice.
Show Display a form, loading it first if necessary.
ShowModal Display a form, loading it first if necessary, and disable all other forms
until this form is resolved.
ShowRestore Restore a form from a call to either Maximize or Minimize.
TextOut Print text on the form.
UnloadForm Remove the hWnd from a form, rendering it inoperative.
Event Use to...
Activate Perform an action when a form becomes active.
Click Perform an action when the user presses and releases a mouse button while on
an object, or when the value of a control is changed in code.
DblClick Perform an action when the user presses and releases a mouse button twice in
rapid succession over an object.
Deactivate Perform an action on the active form immediately before a different form
becomes active.
GotFocus Define what occurs when an object is given the focus.
InPlaceMenu Merge the menus of the Object (server) and Container when an Ole Server is
activated "in-place."
KeyDown Define what occurs when the user presses a key while an object has the focus.
KeyPress Define what occurs when the user presses and releases an ANSI key.
KeyUp Define what occurs when the user releases a key while an object has the focus.
Load Perform an action when a form is loaded.
LostFocus Define what occurs when an object loses the focus.
Paint Run an interpretive method when repainting is necessary.
Resize Perform an action when a form first appears on the screen or when the size of
the form changes.
Unload Perform an action when the form is unloaded
Copied Features:
Properties
Methods
Events
Details:
A Form's properties allow you to specify things such as form size and location
and certain behaviors, such as whether or not the form can be resized.
A Form's methods provide a means for handling the form from code. Procedures
entered into a form's code area are local to that form, meaning they cannot be
accessed by other forms.
Forms can also be programmed to react to different events. Forms can respond
to both user- and system-initiated events. For example, you can write code in a
form’s Click event procedure that allows the user to change the form's location
simply by clicking it.
When designing your forms, it is easy to define or remove a border
(BorderStyle), a title (Caption), or Maximize and Minimize buttons. For example, to
remove a border, simply set the BorderStyle to 0. To include a title, enter the
desired text in the Caption property. And to include or remove the Maximize and
Minimize buttons, change their properties to True or False, respectively.
To make a form visible or invisible, use the Hide and Show methods.
Note: Caption has no effect on an embedded form.