ComboBox

This control is used to display a drop-down, scrollable list of items that the user can select from without taking up the space that is required for a listbox control. Also with the associated edit control; it is possible to allow the user to enter items that are not present in the drop-down list.

The control has the following properties:

Property

Default

Description

Items

-

Contains the individual items of display text represented as strings displayed in the drop-down list region of the combo box.

Style

csDropDown

Determines the display style of the combo box.

Text

-

Contains the selected text in the edit region of the control.

These are three ComboBox Style property values:

 

The dialogue form also has a set of properties. These properties can be shown in the object inspector by clicking the mouse on an empty place on the form that is not occupied by controls.

Property

Default

Description

BorderStyle

bsDialog

The type of the dialogue form, fixed size or sizeable window.

Caption

-

The text display in the title bar of the window.

Color

clBtnFace

Specifies the background color of the window.

Height

-

Specifies the vertical size of the window.

Left

-

Specifies the coordinate of the left edge of the window.

OnActivate

-

Occurs after initialization of all elements of the window.

Position

poScreenCenter

Represents the size and placement of the window.

Top

-

Specifies the Y coordinate of the top edge of the window.

Type

ptDialog

Specifies the type of form, a dialogue form or report page form.

Width

-

Specifies the horizontal size of the window.

The OnActivate property closely corresponds with the same event in other Delphi forms. It is executed after all of the controls that are on the dialogue form are initialized and just before the form is ready to be displayed on the screen. Use the OnActivate property for initializing values in the form’s controls. For example, the Items property string list of a ListBox control can be populated with values at this time.