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:

The sample shows the words Health Insurance : highlighted with a light gray background and a small box to their right with an x inside.

StepsTo use the CheckBox edit style:

  1. In the Edit property page, select CheckBox in the Style Type drop-down list and specify properties for that style.

  2. In the Text box, enter the text you want displayed next to the check box.

    NoteUsing accelerator keys If the CheckBox has an accelerator key, enter an ampersand (&) before the letter in the text that represents the accelerator key.

  3. 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, Sybase WorkSpace enters the appropriate data value in its buffer. When the Update method is called, Sybase WorkSpace 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.

StepsTo center check boxes without text:

  1. 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.

  2. In the General property page, specify centering (Alignment>Center) or specify centering using the StyleBar.