CommandButton, CommandGroup
Command buttons are generally use to make something happen. Perhaps the most common command buttons are the ones labeled "OK" and "Cancel" that appear in dozens of dialogs throughout Windows.In Visual FoxPro, command buttons can be used both singly and in groups. CommandGroups have a Value property that indicates which button in the group was last chosen. The Value can be either character or numeric. When character, it contains the Caption of the button last chosen. When numeric, it's the position of that button in the group. Command buttons can contain text or a bitmap or both. In addition, command buttons can be invisible. Of course, in that case, the bitmap and the caption don't do you much good. Invisible buttons are one way to put a "hot spot" on a form. A command group can contain any combination of textual, graphical and invisible buttons.CommandButton
Property |
Value |
Purpose |
Logical |
Should this button be resized automatically to fit the caption? |
|
Logical |
Should this button be chosen when the Esc key is pressed? |
|
Character |
The message that appears on the button. |
|
Logical |
Should this be the default button, chosen by pressing Enter? |
|
Character |
The names (including path) of graphic files to appear on the button. Picture appears when the button is enabled and not pressed. DownPicture appears when the button is pressed. DisabledPicture appears when the button is disabled. |
|
Numeric |
Determines the appearance of the button—3-D (0), Plain (1), or "hot tracking" (2), in which the button is flat until the mouse passes over it or it gets focus. |
|
Numeric |
Determines whether the button is visible (0) or invisible (1). |
|
Numeric |
Determines appearance of the button, set at runtime only—leave existing effect (0), raised (1), or sunken (2). Added in VFP 7. |
Event |
Purpose |
Fires when the button is "pressed," using either the mouse or the keyboard. |
|
Fires when the mouse moves into the area occupied by the button. |
|
Fires when the mouse moves out of the area occupied by the button. |
CommandGroup
Property |
Value |
Purpose |
Logical |
Should the group be resized to completely contain all of its buttons? |
|
Numeric |
Should the group let objects behind it show through or not? Objects behind the buttons themselves do not show through regardless, unless the button's Style is set to invisible. |
|
Numeric |
Color used for the border around the group. |
|
Numeric |
Determines whether or not there is a border around the group. |
|
Numeric |
The number of buttons in the group. |
|
Collection |
References to the buttons in the group. |
|
Collection |
References to the buttons in the group. |
|
Numeric |
The tab order of the button within the group. |
|
Numeric or Character |
Which button in the group was chosen last? |
Event |
Purpose |
Fires when a button in the group is "pressed," and doesn't have any Click code of its own. |
|
Fires when any button in the group is chosen, because the group's Value changes. |
|
Fires when the mouse moves into the area occupied by the button. |
|
Fires when the mouse moves out of the area occupied by the button. |
Example |
* Perhaps the most common button of all. * Of course, we'd do this in the Class Designer. DEFINE CLASS CloseButton AS CommandButton Caption = "\<Close" ToolTipText = "Close this form" PROCEDURE Click IF EMPTY(ThisForm.PARENT) && A stand-alone form ThisForm.Release() ELSE ThisFormSet.Release() && A formset ENDIF ENDPROC ENDDEFINE |