You use a CommandButton to carry out an action. For example, you can use an OK button to confirm a deletion or a Cancel button to cancel the requested deletion.
CommandButton property |
Datatype |
Description |
---|---|---|
String |
A description of the control and/or its purpose for use by accessibility tools such as readers for visually impaired users. |
|
String |
A label that briefly describes the control, such as the text in a button or the name of a menu item. |
|
AccessibleRole (enumerated) |
Describes what kind of user interface element the control is. |
|
Boolean |
Specifies whether PowerBuilder moves the control to the top of the front-to-back order of the window. Values are: TRUE -- Move to the top. FALSE -- Do not move to the top. |
|
Boolean |
Specifies whether the control acts as the Cancel button. (The Cancel button receives a Clicked event if the user presses Esc.) Values are: TRUE -- Acts as the Cancel button. FALSE -- Does not act as the Cancel button. |
|
ClassDefinition |
PowerObject |
An object of type PowerObject containing information about the class definition of the object or control. |
Boolean |
Specifies whether the control is the default control. The default control has a thick border and receives a Clicked event if the user presses Enter without selecting a control. Values are: TRUE -- Acts as the default. FALSE -- Does not act as the default. Editable controls Default behavior can be affected by editable controls on the window. For more information, see Users Guide. |
|
Boolean |
Specifies whether PowerBuilder puts the control automatically into Drag Mode. Values are: TRUE -- When the control is clicked, the control is automatically in Drag Mode. FALSE -- When the control is clicked, the control is not automatically in Drag Mode. You have to put the control into Drag Mode manually by using the Drag function. |
|
String |
Contains the name of the stock icon or the file containing the icon you want to display when the user drags the control (the ICO file). The default icon is a box the size of the control. When the user drags the control, the icon displays when the control is over an area in which the control can be dropped (a valid drop area). When the control is over an area that is not a valid drop area, the No-Drop icon displays. |
|
Boolean |
Specifies whether the control is enabled (can be clicked). Values are: TRUE -- Control is enabled. FALSE -- Control is not enabled. |
|
String |
Specifies the name of the typeface in which the text of the control displays (for example, arial or courier). |
|
FlatStyle |
Boolean |
Specifies that the edge of the button displays only when the mouse hovers over it. This is the button style used in the Microsoft Rebar (coolbar) control. Values are: TRUE -- Button has a flat appearance. FALSE -- Button does not have a flat appearance. |
FontCharSet (enumerated) |
Specifies the font character set used for the text in the control. The application must be running on an appropriate version of PowerBuilder under an operating system that supports the selected character set. For a complete list of possible values, see the list of properties for the FontCharSet variable on the Enumerated tab page of the Browser. |
|
FontFamily (enumerated) |
Specifies the font family (type style) used for the text in the control. Values are: AnyFont! Decorative! Modern! Roman! Script! Swiss! |
|
FontPitch (enumerated) |
Specifies the pitch (spacing) of the font used for the text in the control. Values are: Default! Fixed! Variable! |
|
Integer |
Specifies the height of the control, in PowerBuilder units. |
|
Boolean |
Specifies whether the text in the control is italic. Values are: TRUE -- Text is italic. FALSE -- Text is not italic. |
|
String |
Specifies the name of the stock pointer of the file containing the pointer that is used for the control. |
|
Integer |
Specifies the tab value of the control within the window (0 means the user cannot tab to the control). |
|
String |
Specifies the tag value assigned to the control. |
|
String |
Specifies the text that displays in the control. |
|
Integer |
Specifies the size of the text in the control, in points. For backward compatibility, the size is stored as a negative number; for example, 10-point text size is stored as -10. |
|
Boolean |
Specifies whether the text in the control is underlined. Values are: TRUE -- Text is underlined. FALSE -- Text is not underlined. |
|
Boolean |
Specifies whether the control is visible. TRUE -- Control is visible. FALSE -- Control is not visible. |
|
Integer |
Specifies the stroke weight of the text in the control; for example, 400 for normal or 700 for bold. |
|
Integer |
Specifies the width of the control, in PowerBuilder units. |
|
Integer |
Specifies the X position (the distance from the left edge of the window), in PowerBuilder units. |
|
Integer |
Specifies the Y position (the distance from the top of the window), in PowerBuilder units. |
CommandButton event |
Occurs |
---|---|
When the control is clicked |
|
Immediately before the Open event occurs in the window |
|
Immediately after the Close event occurs in the window |
|
When a dragged control is dropped on the control |
|
When a dragged control enters the control |
|
When a dragged control leaves the control |
|
When a dragged control is within the control |
|
Before the control receives focus (before it is selected and becomes active) |
|
When the user presses the F1 key or drags the context help button (question mark) from the title bar to a menu item or control |
|
When the control loses focus (becomes inactive) |
|
When a Windows message occurs that is not a PowerBuilder event |
|
When the right mouse button is pressed on the control |
CommandButton function |
Datatype returned |
Description |
---|---|---|
String |
Returns the name assigned to the control |
|
Integer |
Starts or ends the dragging of the control |
|
Integer |
Creates a reference to a context-specific instance of the specified service |
|
PowerObject |
Returns a reference to the name of the parent object |
|
Integer |
Makes the control invisible |
|
Integer |
Moves the control to a specified location |
|
Integer |
Returns the distance of the pointer from the left edge of the control |
|
Integer |
Returns the distance of the pointer from the top of the control |
|
Boolean |
Adds an event to the end of the message queue for the control |
|
Integer |
Prints the control |
|
Integer |
Changes the size of the control |
|
Integer |
Sets focus to the control |
|
Integer |
Specifies the position of the control in the front-to-back order of the window |
|
Integer |
Controls automatic redrawing of the control after each change in its properties |
|
Integer |
Makes the control visible |
|
Integer |
Triggers a specified event in the control and executes the script for the event |
|
Object |
Returns the control type of the control |