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. Select CheckBox from the EditStyle 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 CheckBox On and Off fields, enter the values you want put in the DataWindow buffer when the CheckBox is checked (on) or unchecked (off).

    If you set 3 States to True, 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, DataWindow .NET enters the appropriate data value in its buffer. When the UpdateData method is called, DataWindow .NET 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. Set LeftText to False and clear the Text field, then specify Alignment>Center in the General category.