[Overview][Constants][Types][Classes][Procedures and functions][Index] | Reference for unit 'StdCtrls' (#lcl)

# TListBox

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

TListBox : a simple string list from which a choice is made

## Declaration

Source position: stdctrls.pp line 624

`type TListBox = class(TCustomListBox)`
`published`
`property Align;` |  | Used to align the control to the top, bottom, left or right of its client.
`property Anchors;` |  | The set of anchor definitions for this control
`property BidiMode;` |  | BiDiMode - enabling bi-directional writing
`property BorderSpacing;` |  | Determines the border spacing for this control
`property BorderStyle;` |  | BorderStyle - none, or single
`property ClickOnSelChange;` |  | Performs Click procedure when the selection is changed (which usually puts the selected item into the edit box)
`property Color;` |  | Determine the colour for the current control
`property Columns;` |  | Columns - the number of vertical columns in which the Items are arranged
`property Constraints;` |  | Determine Constraints (max and min height and width) for this control
`property DragCursor;` |  | DragCursor - the style of cursor to be used during the Drag process
`property DragKind;` |  | DragKind - what sort of dragging? Drag or Dock
`property DragMode;` |  | DragMode - whether manual or automatic
`property ExtendedSelect;` |  | ExtendedSelect - boolean. Whether extended selection is allowed. Default True
`property Enabled;` |  | Whether the control is Enabled (read/write). If not, it usually appears 'greyed-out'
`property Font;` |  | The font to be used for text in this control (read/write).
`property IntegralHeight;` |  | not implemented
`property Items;` |  | Items - an array of strings representing the list of entries
`property ItemHeight;` |  | ItemHeight - the height of the individual Items
`property MultiSelect;` |  | MultiSelect - allows more than one Item from the list to be selected at a time, by pressing the CTRL or SHIFT key while selecting
`property OnChangeBounds;` |  | Event handler for a change in bounds of the control
`property OnClick;` |  | Event Handler for mouse click
`property OnContextPopup;` |  | Event handler to supply information when a context-sensitive pop-up menu is required
`property OnDblClick;` |  | Event Handle for mouse double-click
`property OnDragDrop;` |  | Event handler for the drop of a control onto this control.
`property OnDragOver;` |  | Event handler for the case when a control is dragged over another control
`property OnDrawItem;` |  | OnDrawItem - event handler for drawing an Item
`property OnEnter;` |  | OnEnter - event handler for when the mouse enters the control, and the control receives focus
`property OnEndDrag;` |  | Event handler for the end of a dragging process
`property OnExit;` |  | OnExit - event handler for when the mouse leaves the control and it loses focus
`property OnKeyPress;` |  | OnKeyPress - event controller for a key being pressed while the control has focus. To properly handle national chars use UTF8KeyPress instead.
`property OnKeyDown;` |  | OnKeyDown - event handler for instance when key is down while control has focus
`property OnKeyUp;` |  | OnKeyUp - event handler for instance when a key is up (not pressed) while the control has focus
`property OnMeasureItem;` |  | Event handler when an item requires to be measured
`property OnMouseMove;` |  | Event handler for mouse movement within the current control
`property OnMouseDown;` |  | Event handler for when a mouse button is pressed down
`property OnMouseUp;` |  | Event handler for when the mouse button is released, ie "up"
`property OnMouseEnter;` |  | Event handler for when the mouse enters the area of the current control
`property OnMouseLeave;` |  | Event handler for when the mouse leaves the area of the current control
`property OnMouseWheel;` |  | OnMouseWheel - event handler for a movement of the mouse wheel
`property OnMouseWheelDown;` |  | OnMouseWheelDown - event handler for downward movement of mouse wheel
`property OnMouseWheelUp;` |  | OnMouseWheelUp - event handler for upward movement of mouse wheel
`property OnResize;` |  | Event Handler for resize of control
`property OnSelectionChange;` |  | OnSelectionChange - event handler for changing the Item selected
`property OnShowHint;` |  | Event Handler when a hint needs to be shown
`property OnStartDrag;` |  | Event handler for start of dragging process
`property OnUTF8KeyPress;` |  | UTF8KeyPress - event controller for a key being pressed while the control has focus.
`property ParentBidiMode;` |  | ParentBiDiMode - does the control follow the BiDiMode settings of its parent?
`property ParentColor;` |  | ParentColor - should the control have the same colour as the parent? Default is true
`property ParentShowHint;` |  | ParentShowHint - does the control adopt the same hinting behaviour as its parent? Default is true
`property ParentFont;` |  | ParentFont - should the control use the same font as the parent? Default is true
`property PopupMenu;` |  | PopupMenu - a context-sensitive menu that pops up when the right mouse button is clicked over this control
`property ScrollWidth;`
`property ShowHint;` |  | Flag to determine: Is hint to be displayed for this control?
`property Sorted;` |  | Sorted - whether the selected Items in the list have been arranged in alphabetical order
`property Style;` |  | Style of List Box - normal, owner-draw fixed, or owner-draw variable
`property TabOrder;` |  | The place this control occupies in the list of tabs
`property TabStop;` |  | Is the control in the sequence of controls accessed by successive presses of the Tab key?
`property TopIndex;` |  | Topindex - the highest value of Index in this list
`property Visible;` |  | Visible - can the control be seen?
`end;`

## Inheritance

`TListBox` |  | TListBox : a simple string list from which a choice is made
`TCustomListBox` |  | TCustomList Box : the base class for TListBox
`TWinControl`
`TControl`
`TLCLComponent` |  | TLCLComponent - base class for LCL components
`TComponent,IUnknown,IInterfaceComponentReference`
`TPersistent`
`TObject`

## Description

TListBox : a simple string list from which a choice is made

The array of strings is held in Items

Clicking on the ellipsis (...) next to the Items entry in the Object Inspector at design-time opens a string-list editor in which the individual text-strings for the list can be entered or edited. The editor also allows the entries to be sorted alphabetically in normal or reverse order.

## See also

HowToUseStdCtrls |  | How to use StdCtrls, ComCtrls or ExtCtrls

The latest version of this document can be found at lazarus-ccr.sourceforge.net.