Cheked List Boxes

Páginas: 9 (2169 palabras) Publicado: 20 de mayo de 2012
Checked List Boxes


Introduction

A Check List Box is a List Box whose items are each equipped with a check box:

Figure 89: The Project Options Dialog Box

A Check List Box combines the functionalities of the List Box and the Check Box controls. As a list box, it displays each of its items on a line. If there are too many items than the control can display, it would be equipped with avertical scroll bar. As described for the list box, if at least one of the items is wider than the control's width, you can make the list box display a horizontal scroll bar.

To select an item in the list, the user can click the desired string. Unlike the regular list box, the user cannot select more than one string in the list. For this reason, if you desire a normal list of objects, use theregular List Box control. The most important and obvious characteristic of the Check List Box is that each item displays a check box on its left. This box allows the user to select or deselect each item. To select an item, the user must click its box and not its string, to indicate an explicit selection. This draws a check mark in the box. As described with the Check Box control, the user candeselect a string by removing the check mark. The check mark indicates that an item is selected and the absence of the check mark indicates the contrary. Like the Check Box control, you can allow the user to indicate a "half-checked" item. In this case, a check box can appear unchecked, checked, or grayed.



Practical Learning Practical Learning: Creating a Pizza Application

1. Start anew project with its default form
2. Save the project in a new folder named Pizza1
3. Save the unit as Main and the project as Pizza
4. Design the form as follows:

Control Name Caption Other Properties
Form BorderStyle: bsDialogShowHint: true
GroupBox Caption: Pizza Size
RadioButton rdoSmall Small Alignment: taLeftJustify
RadioButton rdoMedium MeiumAlignment: taLeftJustify
RadioButton rdoLarge Large Alignment: taLeftJustify

5. Save All

Characteristics of a Checked List Box

To provide a Check List Box, from the Additional tab of the Tool Palette, click the CheckListBox button and click the form or container that would host the control.

Like the regular List Box control, the items of a Check List Box object are AnsiString stringscontrolled by a TStrings list called Items. At design time, to create a list of items and add it to the control, open the String List Editor dialog box, add the necessary strings, and click OK. Of course, you can add the strings at run time, using the Items::Add() method.

After creating the list, each item appears with a flat check box to its left. If you want a 3-D check box, you can changethe Boolean Flat property from its true default to a false value:

Flat = true Flat = false

When you create the list, the items are stored in the same order you entered them, if you want, you can rearrange them alphabetically or numerically. This can be done by setting the Boolean value of the Sorted property accordingly. As described for the list box, if you set it to true, the items of theCheck List Box would be sorted. If you set it back to false, the items of the list box would not go back to the way they were but new items would be added at the end of the list.

If you provide a longer list than the control's height can display, it would have a vertical scroll bar. If just one or a few items are hidden by the scroll bar, you can heighten it if the form provides more space.Alternatively, you can also create the list in various columns. To do this, set the value of the Columns property to a number of your choice. Here is a Check List Box with two columns:

Normally, the number of columns should not exceed 5 or this would indicate that you may simply need more than one Check List Box control:

If at least one of the items is wider than the width of the control, you...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • chek list
  • Chek list
  • Chek list cultura organizacional
  • Como elaborar un chek list
  • Chek List Puestos Trabajo
  • List Box Visual Basic
  • chek list
  • Chek list

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS