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.

StepsTo use the CheckBox edit style:

  1. Select CheckBox from the Style Type box for a DataWindow column.

  2. If you want a label as part of the CheckBox style for the column, enter the label for the check box in the Text box.

    By default, the label displays to the right of the check box when you make the column wide enough to accomodate both the check box and the label. If you want the label to display to the left of the check box, select the Left Text check box on the Edit page of the Properties view for the column.

    NoteUsing accelerator keys You can designate an accelerator key in a CheckBox label by including an ampersand (&) before the letter that you want to use for the accelerator. On the desktop, the Alt key in combination with the accelerator key changes focus to the CheckBox control and changes the value of the control.

    On a Windows CE device, the SIP keyboard allows users to enter an accelerator key that changes the value of the check box. However, because it does not have an Alt key, the SIP keyboard cannot be used to change focus to the check box control.

  3. Enter the values you want to have placed in the DataWindow buffer:

  4. (Optional) Select the 3 States check box, then enter a value for a third CheckBox state in the Other State box.

    The Other State box does not display unless you select the 3 States check box.

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, PocketBuilder enters the appropriate data value in its buffer. When the Update function is issued, PocketBuilder sends the corresponding data values to the database.

Centering check boxes without text

You might 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.

StepsTo center check boxes without text:

  1. In the Edit properties 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.

  2. Specify centering (Alignment>Center) in the General properties page, or specify centering using the StyleBar.