Introduction to PowerBuilder
CommandButton
A CommandButton is used to
allow the user to trigger an action. You'll probably be familiar
with the OK and Cancel buttons used in standard Windows dialog
boxes, allowing the user to take control of whether or not a task
is to be completed.

A
Window with a CommandButton
PowerBuilder
allows you to pass on this functionality to your users by
providing CommandButtons that can be customized, while allowing
you to modify the code behind each button to perform the options
that you have to offer.

CommandButton
Properties Dialog Box
Typically, we
write code for the clicked event ( We will explain about events
after couple of sessions ) of CommandButton, i.e., we specify the
action to be taken whenever the user clicks on this
CommandButton. Some users are from the DOS background, they have
the habit of using keyboard than the mouse, might even press Enter key. Whenever user hits the Enter key, the Clicked event script should be
executed. To achieve this functionality, you need to turn on the Default property. Border of a CommandButton
which has Default property turned on, would appear black
and thicker.
Similarly there is
one more property, Cancel. Selecting this property will execute
the CommandButton's Clicked event, whenever user press Esc button. Default and Cancel properties are not exclusive. If you
need to run the same code for Enter as well as Esc keys, you can turn on these properties.
One limitation of
the CommandButton is that, you can't change the background color
and the border.
|