TSRVCustomComboBox

<< Click to display table of contents >>

TSRVCustomComboBox

TSRVCustomComboBox is the base class for combo box controls.

Unit SRVComboBox;

Syntax

TSRVCustomComboBox = class(TSRVEditControl);

Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TSRVWinControl

TSRVEditControl

Properties and events

Public properties

Property

Type

Default value

Meaning

AutoComplete

Boolean

True

Specifies whether the combo box automatically completes words that the user types by selecting the first item that begins with the currently typed string.

AutoDropDown

Boolean

False

Specifies whether the drop-down list drops down automatically in response to user keystrokes.

AutoSize

Boolean

True

Determines whether the height of the edit region automatically resizes to accommodate the text height

CharCase

TSRVEditCharCase

srvecNormal

Determines the case of the text within the edit region:

srvecNormal, srvecUpperCase, srvecLowerCase

Color

TColor

clWindow

Background color of the editing region.

DropDownCount

Integer

5

Specifies the maximum number of items displayed in the drop-down list.

DropDownHints

Integer

10

Defines how many hints (suggestions) are visible in a list.

HideSelection

Boolean

True

Determines whether the visual indication of the selected text remains when focus shifts to another control.

HintsItemSkinSchemeIndex

Integer

 

An index in SkinManager.CurrentSkin.BoxSchemes collection, for items in the list of hints (suggestions)

HintsScrollBarSkinSchemeIndex

Integer

 

An index in SkinManager.CurrentSkin.VerticalScrollBarSchemes collection, for scrollbars in the list of hints (suggestions)

HintsSkinSchemeIndex

Integer

 

An index in SkinManager.CurrentSkin.BoxSchemes collection, for the list of hints (suggestions)

ImageList

TCustomImageList

 

Specifies the images that appear next to items in the list box.

ItemHeight

Integer

20

Specifies the height in pixels of an item in an owner-draw list.

When the screen DPI is changed, this value is recalculated.

ItemIndex

Integer

 

Specifies the ordinal number of the selected item.

ItemWidth

TRVPixel96Length

0

If set to a positive value, defines a width of a drop down list.

Items

TSRVCBoxItemCollection

 

Items, a collection of TSRVCBoxItem.

ListMarginHeight

TRVPixel96Length

2

Top and bottom margins in each item.

ListMarginWidth

TRVPixel96Length

3

Left and right margins of each item.

MaxLength

Integer

0

Specifies the maximum number of characters the user can type into the edit portion (0 for unlimited)

Modified

Boolean

 

Indicates whether the user edited the text of the edit control.

ReadOnly

Boolean

False

Determines whether the user can change the text of the edit region.

readonly ScrollBar

TSRVScrollBar

 

Read-only. Returns a scroll bar object.

Sorted

Boolean

False

Specifies whether the items in a list box are arranged alphabetically.

Style

TComboBoxStyle

csDropDown

Determines the display style of the combo box.

Text

String

 

Text in the editing region.

UseItemFontNames

Boolean

False

Specifies whether the FontName properties of items are used to display their Captions.

UseSelectedImagesInHotState

Boolean

False

Specifies whether Items[].SelectedImageIndex is used instead of Items[].ImageIndex for highlighted items (below the mouse pointer).

Public properties working only if SRVControlStyle = srvcsClassic:

Property

Type

Default value

Meaning

SelectedItemBackColor

TColor

clHighlight

Background color for the selected item.

SelectedItemBorderColor

TColor

clSilver

Border color for the selected item.

SelectedItemTextColor

TColor

clHighlightText

Text color for the selected item.

Public events

OnChange occurs when the user changes the text displayed in the edit region.

OnDropDown occurs when the user opens the drop-down list.

OnMeasureItem occurs when the application needs to redisplay an item in a variable height owner-draw list box.

OnDrawItem occurs when an item in an owner-draw list box needs to be redisplayed.

OnEditHints occurs when a list of hints (suggestions) is about to be displayed. See the section about "Hints (Suggestions)" for TSRVEdit.

 

See also properties and events inherited from TSRVEditControl.

Methods

BeginUpdate/EndUpdate locks/unlocks redrawing.

IndexOf returns the index of item by its Caption.

ItemHasParent returns True if the given item has a parent item.

GetItemParent returns the index of the parent item for the given item.

AppendItem adds an item with the specified properties to the end of the item list.

InsertItem inserts an item with the specified properties at the position Index.

DeleteItem deletes the specified item.

Inherited components

SRVEdit TSRVComboBox