Form, Formset
Forms and formsets are container classes that, from one point of view, put the "visual" in Visual FoxPro. Formsets contain forms and toolbars. Forms contain controls.Form
Property |
Value |
Meaning |
Object |
A reference to the control on the form that currently has focus. |
|
Logical |
Determines whether this form always stays underneath other windows, like a kind of wallpaper. |
|
Logical |
Determines whether this form stays on top of other windows, even when it doesn't have focus. |
|
Logical |
Determines whether the form automatically centers itself when it first appears. Also allows you to center a form at any time. |
|
Numeric |
Determines the type of border of the form. Also determines whether the form can be resized. |
|
Numeric |
Determines the type of buffering used for cursors in the form's data environment, unless the cursors override this setting individually. |
|
Character |
The title that appears in the form's border. |
|
Logical |
Determines what gets redrawn when the form is resized or controls are moved about. |
|
Logical |
Determines whether the form can be closed by the operator with the mouse and Ctrl+F4. |
|
Logical |
Determines how the form behaves when you use the scrollbars. |
|
Logical |
Determines whether the form has a Windows standard control menu. |
|
Numeric |
The number of controls currently on the form. |
|
Collection |
References to the controls currently on the form. |
|
Numeric |
The position of the drawing cursor on the form. |
|
Numeric |
Determines whether the form has its own private data session. |
|
Numeric |
The data session being used by the form. |
|
Numeric |
Indicates the default locale ID (language) for OLE objects used in the form. |
|
Logical |
Determines whether the form is contained in the main Visual FoxPro window. |
|
Numeric |
Determines the way colors work in drawing methods. |
|
Numeric |
The type of lines drawn by drawing methods. |
|
Numeric |
The width of lines drawn by drawing methods. |
|
Numeric |
The color used to fill figures drawn with drawing methods. |
|
Numeric |
The pattern used to fill figures drawn with drawing methods. |
|
Logical |
Determines whether the title bar uses a FoxPro/DOS compatibility style or the standard Windows style. Although the two choices are nearly indistinguishable visually, there are functional differences. Keep this property set to .F. |
|
Numeric |
Determines how far the form scrolls on a single click on a horizontal scroll arrow. |
|
Numeric |
The Windows window handle of the form. |
|
Character |
The icon file used in the form's title bar. |
|
Logical |
Determines whose KeyPress event fires when the user presses a key—the form's or the control's. |
|
Logical |
Determines whether the form is visually updated immediately when some kinds of changes are made to the form or its controls. |
|
Logical |
Determines whether the form has maximize and minimize buttons. |
|
Numeric |
The largest size to which the user can resize the form. |
|
Numeric |
The position at which the form appears when maximized. |
|
Logical |
Determines whether the form behaves like an MDI (multiple document interface) form. |
|
Numeric |
The smallest size to which the user can resize the form. |
|
Logical |
Determines whether the user can move the form. |
|
Collection |
Contains a reference to every object contained within the form. |
|
Character |
File name of a picture to be tiled as wallpaper on the form. |
|
Numeric |
Indicates how the form was released. |
|
Numeric |
The measurement system used for the form. |
|
Numeric |
Determines what kind of scrollbars, if any, the form has. |
|
Logical |
Determines whether the top-level form appears in the task bar at runtime. Ignored if the ShowWindow property is anything other than 2 (top-level form). |
|
Logical |
Determines whether tooltips are displayed. |
|
Numeric |
Determines whether the form is a child of the VFP window, a top-level form itself, or a child of a top-level form. |
|
Numeric |
Determines whether the form has a title bar. |
|
Numeric |
Indicate the size of the viewport into the form, that is, the size of the visible area. |
|
Numeric |
Indicate the top left corner of the portion of the form currently visible. |
|
Numeric |
Determines how far the form scrolls on a single click on a vertical scroll arrow. |
|
Numeric |
Is the form normal size, maximized or minimized? |
|
Numeric |
Indicates whether the form is modal or modeless. Also used to indicate READ compatibility. |
Event |
Purpose |
Fire when the form gains or loses focus. |
|
First and last events to fire. |
|
Fires when the form is moved. |
|
Fires when part of the form is exposed and has to be redrawn. |
|
Fires when the form is released. Issue NODEFAULT in this method to prevent the form from being destroyed. |
|
Fires when the form is resized. |
|
Fires when the form's scrollbars are used. |
Method |
Purpose |
Drawing methods that put figures on the form. |
|
Drawing method that clears figures and text from the form. |
|
Repaints the form. |
|
Returns the color of a particular point. |
|
Drawing method that puts text on the form. |
|
Sets the color of a particular point. |
|
Destroys the form. |
|
Creates a new SCX based on the currently displayed form. |
|
Creates a new class in a VCX based on the currently displayed form. |
|
Sets the ViewPortLeft and ViewPortTop properties to determine which portion of the form is visible. |
|
Make the form visible and invisible. Show also activates the form initially. |
|
Return the height and width of a specified string in the current form's font. |
FormSet
Property |
Value |
Meaning |
Object |
Reference to the form in the set that has focus. |
|
Logical |
Indicates whether the formset object should be released when all the forms in the set have been released. |
|
Numeric |
Determines the type of buffering used by default for cursors in the formset. |
|
Numeric |
Determines whether the formset has its own private data session. |
|
Numeric |
The data session being used by the formset. |
|
Numeric |
The number of forms in the set. |
|
Collection |
References to the forms in the set. |
|
Collection |
Contains a reference to every object contained within the formset. |
|
ReadCycle, ReadLock, ReadMouse, ReadObject, ReadSave, ReadTimeOut, WindowList |
Various |
Special properties used only in forms converted from FoxPro 2.x screens. They correspond to various READ clauses. |
Numeric |
Indicates whether the formset is modal or modeless. Also used to indicate READ compatibility. |
Event |
Purpose |
Fire when the formset gains or loses focus. |
|
First and last events to fire in the formset. |
|
Events to model FoxPro 2.x READ clauses. Used only for forms converted from FoxPro 2.x screens. |
Method |
Purpose |
Destroys the formset. |
|
Makes the formset visible and invisible. Show also activates the formset initially. |
Example |
DEFINE CLASS HackForm AS Form Caption = "Hacker's Example Form" BackColor = RGB(0,0,255) ForeColor = RGB(255,255,255) PROCEDURE Resize LOCAL cMessage cMessage = "Hey, watch it, buster!" This.Cls This.CurrentX = (This.Width-This.TextWidth(cMessage))/2 This.CurrentY = This.Height/2 This.Print(cMessage) ENDPROC PROCEDURE Moved LOCAL cMessage cMessage = "Who do you think you're moving?" This.Cls This.FillColor = RGB(255,0,0) This.FillStyle = 0 This.Box(This.Width/4, This.Height/4,; 3*This.Width/4,3*This.Height/4 ) This.CurrentY = This.Height/2 This.CurrentX = This.Width/4 + 2 This.Print(cMessage) ENDPROC ENDDEFINE |