The CheckBox edit style
If a column can take only one of two (or perhaps three) values,
you might want to display the column as a check box; users can select
or clear the check box to specify a value. In the following entry from
a DataWindow object, users can simply check or clear a box to indicate
whether an employee has health insurance:
To use the CheckBox edit style
-
Select CheckBox from the Style Type list and specify
properties for that style. -
In the Text box, enter the text you want displayed next to
the check box.Using accelerator keys
If the CheckBox has an accelerator key, enter an ampersand
(&) before the letter in the text that represents the
accelerator key. -
In the Data Value For boxes, enter the values you want put
in the DataWindow buffer when the CheckBox is checked (on) or
unchecked (off).If you selected the 3 States box, an optional third state
box (other) appears, for the case when the condition is neither on
nor off.
What happens
The value you enter in the Text box becomes the display value,
and values entered for On, Off, and Other become the data
values.
When users check or clear the check box at runtime, PowerBuilder
enters the appropriate data value in its buffer. When the Update
method is called, PowerBuilder sends the corresponding data values to
the database.
Centering check boxes without
text
You may find it useful to center check boxes used for columns of
information. First make the text control used for the column header
and the column control the same size and left aligned. Then you can
center the check boxes and the column header.
To center check boxes without text
-
In the Edit property page for the column, make sure the Left
Text check box is not selected and that the Text box where you
specify associated text is empty. -
In the General property page, specify centering
(Alignment>Center) or specify centering using the
StyleBar.