Sign in Join
FPDoc Onlineexperiment

TListView class

In unit ComCtrls

TListView - a window showing a list of Items which may or may not have associated icons.

Declaration

pascal
TListView = class(TCustomListView)

Inheritance

  1. TListView
  2. TCustomListView
  3. TWinControl
  4. TControl
  5. TLCLComponent
  6. TComponent
  7. TPersistent
  8. TObject

Description

TListView- a window showing a list of items which may or may not have associated icons.

At first this control looks very like TListBox but it has a much higher degree of complexity. It is capable of displaying Items in Columns of Rows and it can have images associated with the list Items.

The important information is held in Items, a string-list that can be created using the string-list editor obtained by right-clicking on the ListView in the Form Editor or by clicking on the ellipsis (...) next to the Items entry in the Object Inspector.

A typical application might have two image lists: LargeImages and SmallImages. They contain large and small sizes for the same collection of images. The index positions in the first list would correspond with those in the second list.

SmallImages (if assigned to a string-list) can be displayed beside the text strings in the list view and the programmer would supply code to ensure that when an item with its associated Small Image was selected, the corresponding Large Image would be displayed in another window.

One or more TImageList controls need to be added to the Form Designer and the ImageList Editor can be opened from the pop-up menu obtained by right-clicking on TImageList icon in the Form Designer. The image list can be populated by reading from files. Then in the StringList editor for Items the correct ImageIndex must be assigned to each entry in the list.

See also

Properties

AlignpublishedSpecifies the placement of the control on its Parent control.
AllocBypublishedReduces allocation overhead in the widgetset class by increasing the internal buffer capacity by this block size.
AnchorspublishedThe set of anchor definitions for this control.
AutoSortpublishedControls automatic updates to the sort column and order indicator for the control.
AutoSortIndicatorpublishedIndicates if the control automatically changes the column and/or order indicator when a column is clicked.
AutoWidthLastColumnpublishedResizes the last visible column to fill the remaining display area for the control.
BorderSpacingpublishedDetermines the inner and outer border spacing for this control.
BorderStylepublishedLine style drawn as a border around the control.
BorderWidthpublishedWidth of the Border around the control; default is zero.
CheckboxespublishedDisplays a check box column for the list items on the control.
ColorpublishedThe background color for the control.
ColumnspublishedCollection with the column definitions for the list view control (size, alignment, image index, etc.).
ColumnClickpublishedEnables or disables OnColumnClick events for column headers on the control.
ConstraintspublishedContains the minimum and maximum Width and Height for the control.
DragCursorpublishedThe cursor shape shown during a drag operation.
DragKindpublishedIndicates the action performed for a drag operation: drag-and-drop or drag-and-dock.
DragModepublishedDetermines how a drag operation is started for the control.
EnabledpublishedDetermines whether the control responds to mouse or keyboard input.
FontpublishedThe font to be used for text display in this control.
GridLinespublishedEnables or disables grid lines between rows and columns on the control.
HideSelectionpublishedIf control looses focus, don't paint selection background for selected item(s).
IconOptionspublishedOptions for layouts, which show icons. Sets arrangement of icons, text-wrapping state.
ItemspublishedCollection of list items displayed on the list view control.
LargeImagespublishedImage list which contains "big" icons displayed for view styles on the control.
LargeImagesWidthpublishedContains the Width for the large images used in the list view.
MultiSelectpublishedAllows simultaneous selection of one or more list items using Ctrl+Click, Shift+Click, Ctrl+Shift+Click, or using program code.
OwnerDatapublishedEnables or disables owner data (virtual) mode for the list view control.
OwnerDrawpublishedIndicates if owner-draw mode is used for the control.
ParentColorpublishedUses the Color from the Parent control, when enabled.
ParentFontpublishedIndicates if the Font from the Parent control is used in the control.
ParentShowHintpublishedIf True, the value of ShowHint for the control will be the same as the one from the Parent. Default is True.
PopupMenupublishedA context-sensitive menu that pops up when the right mouse button is clicked over this control.
ReadOnlypublishedDisables editing of list items on the control when set to True.
RowSelectpublishedIndicates if the entire row is highlighted when selected on the list view control.
ScrollBarspublishedSpecifies the scroll bars visible for the control.
ShowColumnHeaderspublishedShow header area in ListView, which shows captions of columns.
ShowHintpublishedEnables Hint display for the control.
SmallImagespublishedImage list which contains "small" icons used for view styles.
SmallImagesWidthpublishedWidth for the images in the SmallImages property.
SortColumnpublishedOrdinal position for the column used to sort the list items, or -1 when not assigned.
SortDirectionpublishedSorting direction (order) for the current SortColumn.
SortTypepublishedSpecifies the sorting mechanism used for the current SortColumn.
StateImagespublishedImage list with the state images for the items on the control.
StateImagesWidthpublishedWidth of the images in the StateImages property.
TabStoppublishedAllows the user to navigate to / from the control by pressing the Tab or Shift+Tab keys.
TabOrderpublishedIndicates the navigation order for the control when the user presses the Tab or Shift+Tab key.
ToolTipspublishedIndicates if a hint (tool tip) is automatically displayed for the list item under the mouse cursor.
VisiblepublishedAllows the control, and all of its children, to be displayed or hidden.
ViewStylepublishedSets one of ListView layouts: List (simple column), Report (few columns with full width), Icon (big icons), Small Icon (small icons, 16x16).

Events

OnAdvancedCustomDrawpublishedEvent handler signalled to custom draw the grid control when the draw state is not cdPrePaint.
OnAdvancedCustomDrawItempublishedEvent handler signalled to custom draw a list item on the grid control when the draw state is not cdPrePaint.
OnAdvancedCustomDrawSubItempublishedEvent handler signalled to custom draw list sub-items when the draw stage is not cdPrePaint.
OnChangepublishedEvent handler signalled when the content for a list item is changed.
OnChangingpublishedEvent handler signalled when a change notification is received for a list item.
OnClickpublishedNotification handler for mouse clicks.
OnColumnClickpublishedEvent handler signalled when a column header for the control is clicked.
OnComparepublishedEvent handler signalled to compare list items in the CustomSort method.
OnContextPopuppublishedInvoked when a context-sensitive pop-up menu is requested.
OnCreateItemClasspublishedEvent handler signalled to get the class reference used to create new list view items.
OnCustomDrawpublishedEvent handler signalled to perform custom drawing for the list view control.
OnCustomDrawItempublishedEvent handler signalled to perform custom drawing for list items on the control.
OnCustomDrawSubItempublishedEvent handler signalled to perform custom drawing for list sub-item on the control.
OnDatapublishedEvent handler signalled to the value(s) for a list item when OwnerData (virtual mode) has been enabled.
OnDataFindpublishedEvent handler signalled to locate list item data when OwnerData (virtual) mode is enabled.
OnDataHintpublishedEvent handler signalled to load a range of cached list items in the virtual storage for the control.
OnDataStateChangepublishedNot used in the current LCL version.
OnDblClickpublishedEvent handler signalled when a mouse double click occurs in the control.
OnDeletionpublishedEvent handler signalled when a list item is deleted from the Items container.
OnDragDroppublishedEvent handler signalled when an object is dropped onto the control.
OnDragOverpublishedEvent handler signalled when a control is dragged over the control instance.
OnDrawItempublishedEvent handler signalled to render an owner drawn item.
OnEditedpublishedEvent handler signalled prior to updating a list item caption when it has been edited in the control.
OnEditingpublishedEvent handler signalled to determine if editing can be performed for a list item in the control.
OnEndDockpublishedEvent handler signalled for the end of a drag-dock operation.
OnEndDragpublishedEvent handler signalled for the end of a drag-drop operation.
OnEnterpublishedEvent handler signalled when the control receives focus.
OnExitpublishedEvent handler signalled when the control loses focus.
OnInsertpublishedEvent handler signalled when a list item is added to or inserted in the Items for the control.
OnItemCheckedpublishedEvent handler signalled when the Checked property for a list item has been changed.
OnKeyDownpublishedEvent handler signalled for key down keyboard events.
OnKeyPresspublishedEvent handler signalled for character data entered by the user.
OnKeyUppublishedEvent handler signalled when a key up event has occurred for the control.
OnMouseDownpublishedEvent handler signalled when a mouse down event is handled for the control.
OnMouseEnterpublishedEvent handler signalled when the mouse pointer has entered the control.
OnMouseLeavepublishedEvent handler signalled when the mouse pointer has left the control.
OnMouseMovepublishedEvent handler signalled when the mouse pointer is moved in the control.
OnMouseUppublishedEvent handler signalled when a mouse up event is handled for the control.
OnMouseWheelpublishedEvent handler for mouse wheel turned.
OnMouseWheelDownpublishedEvent handler signalled for a downward movement of the mouse wheel.
OnMouseWheelUppublishedEvent handler signalled for an upward movement of the mouse wheel.
OnMouseWheelHorzpublishedEvent handler signalled for a horizontal movement of the mouse wheel.
OnMouseWheelLeftpublishedEvent handler signalled for a leftward movement of the mouse wheel.
OnMouseWheelRightpublishedEvent handler signalled for a rightward movement of the mouse wheel.
OnResizepublishedNotification handler for a resize of the control.
OnSelectItempublishedEvent handler signalled when the selected list item for the control is changed.
OnShowHintpublishedEvent handler signalled when a hint window is displayed for the control.
OnStartDockpublishedEvent handler for the start of a docking operation.
OnStartDragpublishedEvent handler signalled for the start of a dragging operation.
OnUTF8KeyPresspublishedHandler for a character entered by the user.

Inherited

From TCustomListView (88)

AddItem AlphaSort BeginAutoDrag BeginUpdate BoundingRect CanChange CanEdit Canvas Change Clear ClearSelection ColClick Column ColumnCount Create CreateListColumns CreateListItem CreateListItems CustomDraw CustomDrawItem CustomDrawSubItem CustomSort DblClick DefaultItemHeight Delete Destroy DestroyWnd DoAutoAdjustLayout DoDeletion DoEndEdit DoGetOwnerData DoInsert DoItemChecked DoOwnerDataFind DoOwnerDataHint DoOwnerDataStateChange DoSelectItem DoSetBounds DrawItem DropTarget Edit EndUpdate FastClear FinalizeWnd FindCaption FindData FlatScrollBars FullDrag GetControlClassDefaultSize GetFirstSelected GetHitTestInfoAt GetItemAt GetListColumnClass GetNearestItem GetNextItem GetNextSelected GetUpdateCount HotTrack HotTrackStyles HoverTime ImageChanged InitializeWnd InitMultiSelList InsertItem IntfCustomDraw IsCustomDrawn IsEditing ItemDeleted ItemFocused ItemIndex ItemInserted KeyDown LastSelected Loaded Notification Repaint SelCount SelectAll Selected ShowWorkAreas Sort SortWithParams TopItem Update UpdateMultiSelList ViewOrigin VisibleRowCount WSRegisterClass

From TWinControl (225)

AddControl AdjustClientRect AlignControls AllAutoSized AutoAdjustLayout AutoSizeDelayed AutoSizeDelayedHandle AutoSizeDelayedReport AutoSizePhases BeginUpdateBounds BoundsLockCount BroadCast Brush BrushCreated CachedClientHeight CachedClientWidth CalculatePreferredSize CanFocus CanSetFocus CanTab ChangeScale ChildClassAllowed ChildHandlesCreated ChildKey ChildSizing ClientRectNeedsInterfaceUpdate CMBiDiModeChanged CMBorderChanged CMDoubleBufferedChanged CMEnabledChanged CMEnter CMExit CMParentDoubleBufferedChanged CMShowHintChanged CMShowingChanged CMVisibleChanged CNChar CNKeyDown CNKeyUp CNSysKeyDown CNSysKeyUp ContainsControl ControlAtPos ControlCount ControlKeyDown ControlKeyUp Controls ControlsAligned CreateBrush CreateDockManager CreateHandle CreateParams CreateParented CreateParentedControl CreateSubClass CreateWnd CustomAlignInsertBefore CustomAlignPosition DefaultHandler DefWndProc DesignerDeleting DestroyHandle DialogChar DisableAlign DoAddDockClient DoAdjustClientRectChange DoAlignChildControls DoAllAutoSize DoAutoSize DoChildSizingChange DockClientCount DockClients DockDrop DockManager DockOver DockSite DoConstraintsChange DoDockClientMsg DoDockOver DoDragMsg DoEnter DoExit DoFlipChildren DoFloatMsg DoGetDockCaption DoKeyDownBeforeInterface DoKeyPress DoKeyUpBeforeInterface DoRemainingKeyDown DoRemainingKeyUp DoRemoveDockClient DoSendBoundsToInterface DoSendShowHideToInterface DoubleBuffered DoUnDock DoUndockClientMsg DoUTF8KeyPress EnableAlign EndUpdateBounds EraseBackground FindChildControl FindNextControl FixDesignFontsPPIWithChildren FixupTabList FlipChildren Focused FontChanged FormEndUpdated GetAdjustedLogicalClientRect GetBorderStyle GetChildren GetChildrenRect GetClientOrigin GetClientRect GetControlIndex GetControlOrigin GetDeviceContext GetDockCaption GetEnumeratorControls GetEnumeratorControlsReverse GetMouseCapture GetParentHandle GetPreferredSizeClientFrame GetSiteInfo GetTabOrderList GetTextLen GetTopParentHandle Handle HandleAllocated HandleNeeded InsertControl IntfGetDropFilesTarget IntfUTF8KeyPress Invalidate InvalidateBoundsRealized InvalidateClientRectCache InvalidatePreferredChildSizes IsClientHeightStored IsClientWidthStored IsControlMouseMsg IsFlipped IsResizing IsSpecialSubControl KeyDownAfterInterface KeyDownBeforeInterface KeyPress KeyUp KeyUpAfterInterface KeyUpBeforeInterface LockRealizeBounds MainWndProc NotifyControls OnAlignInsertBefore OnAlignPosition OnDockDrop OnDockOver OnGetDockCaption OnGetSiteInfo OnUnDock PaintControls PaintHandler PaintTo PaintWindow ParentDoubleBuffered ParentFormHandleInitialized ParentHandlesAllocated ParentWindow PerformTab RealGetText ReAlign RealizeBounds RealizeBoundsRecursive RealSetText ReloadDockedControl RemoveControl RemoveFocus ScaleBy ScaleControls ScrollBy ScrollBy_WS SelectFirst SelectNext SendDialogChar SendMoveSizeMessages SetBorderStyle SetBounds SetChildZPosition SetColor SetControlIndex SetDockManager SetFocus SetShape SetTempCursor ShowControl Showing UnlockRealizeBounds UpdateControlState UpdateDockCaption UpdateShowing UseDockManager UTF8KeyPress VisibleDockClientCount WindowHandle WMChar WMContextMenu WMDestroy WMEnter WMEraseBkgnd WMExit WMKeyDown WMKeyUp WMKillFocus WMMove WMNotify WMPaint WMSetFocus WMShowWindow WMSize WMSysChar WMSysKeyDown WMSysKeyUp WMWindowPosChanged WndProc WriteLayoutDebugReport WSSetText

From TControl (324)

AccessibleDescription AccessibleName AccessibleRole AccessibleValue Action ActionChange ActionLink ActiveDefaultControlChanged AddHandler AddHandlerOnBeforeDestruction AddHandlerOnChangeBounds AddHandlerOnEnabledChanged AddHandlerOnEnabledChanging AddHandlerOnKeyDown AddHandlerOnMouseWheel AddHandlerOnResize AddHandlerOnVisibleChanged AddHandlerOnVisibleChanging AdjustSize AnchorAsAlign AnchorClient AnchoredControlCount AnchoredControls AnchorHorizontalCenterTo AnchorParallel AnchorSame AnchorSide AnchorSideBottom AnchorSideChanged AnchorSideLeft AnchorSideRight AnchorSideTop AnchorToCompanion AnchorToNeighbour AnchorVerticalCenterTo AssignTo AutoSize AutoSizing AutoSizingAll AutoSizingLockCount BaseBounds BaseParentClientSize BeforeDestruction BeforeDragStart BeginAutoSizing BeginDrag BiDiMode BoundsChanged BoundsRect BoundsRectForNewParent BringToFront CalculateDockSizes CanAutoSize Caption CaptureChanged CaptureMouseButtons ChangeBounds Changed CheckChildClassAllowed CheckNewParent CheckOnChangeBounds Click ClientHeight ClientOrigin ClientRect ClientToParent ClientToScreen ClientWidth CMChanged CMCursorChanged CMHintShow CMHitTest CMMouseEnter CMMouseLeave CMParentBiDiModeChanged CMParentColorChanged CMParentFontChanged CMParentShowHintChanged CMSysFontChanged CMTextChanged CNPreferredSizeChanged ColorIsStored ConstrainedResize ControlFontClass ControlOrigin ControlState ControlStyle ControlToScreen CreateAccessibleObject CreateControlBorderSpacing CreateFloatingDockSite Cursor DefineProperties DesktopFont DisableAutoSizing DoBorderSpacingChange DoCallKeyEventHandler DoCallMouseWheelEventHandler DoCallNotifyHandler Dock Docked DockOrientation DockTrackNoTarget DoContextPopup DoDock DoEndDock DoEndDrag DoFixDesignFontPPI DoMouseDown DoMouseUp DoMouseWheel DoMouseWheelDown DoMouseWheelHorz DoMouseWheelLeft DoMouseWheelRight DoMouseWheelUp DoOnChangeBounds DoOnParentHandleDestruction DoOnResize DoOnShowHint DoScaleFontPPI DoStartDock DoStartDrag DragCanceled DragDrop Dragging DragOver EditingDone EnableAutoSizing EnabledChanged EnabledChanging EndAutoSizing EndDrag ExecuteCancelAction ExecuteDefaultAction FindSubComponent FixDesignFontsPPI Floating FloatingDockSiteClass ForeignAnchorSideChanged FormIsUpdating GetAccessibleObject GetAction GetActionLinkClass GetAnchorsDependingOnParent GetCachedText GetCanvasScaleFactor GetChildAccessibleObjectAtPos GetClientScrollOffset GetColorResolvingParent GetCursor GetDefaultColor GetDefaultDockCaption GetDefaultHeight GetDefaultWidth GetDockEdge GetDragImages GetEnabled GetFloating GetFloatingDockSiteClass GetLogicalClientRect GetMousePosFromMessage GetPalette GetParentBackground GetParentComponent GetPopupMenu GetPreferredSize GetRGBColorResolvingParent GetScrolledClientRect GetSelectedChildAccessibleObject GetSidePosition GetTextBuf GetTopParent HandleObjectShouldBeVisible HasHelp HasParent Height HeightIsAnchored HelpContext HelpKeyword HelpType Hide Hint HostDockSite InitiateAction InvalidateControl InvalidatePreferredSize IsAParentAligning IsBorderSpacingInnerBorderStored IsCaptionStored IsControl IsControlVisible IsEnabled IsParentColor IsParentFont IsParentOf IsProcessingPaintMsg IsRightToLeft IsVisible Left LMCaptureChanged LoadedAll LRDockWidth ManualDock ManualFloat MouseCapture MouseDown MouseEnter MouseInClient MouseLeave MouseMove MouseUp OnChangeBounds OnConstrainedResize OnEditingDone OnQuadClick OnTripleClick Parent ParentBackground ParentBiDiMode ParentDestroyingHandle ParentFontChanged ParentToClient Perform PositionDockRect QuadClick ReadBounds ReadState Refresh RemoveAllHandlersOfObject RemoveHandler RemoveHandlerOnBeforeDestruction RemoveHandlerOnChangeBounds RemoveHandlerOnEnabledChanged RemoveHandlerOnEnabledChanging RemoveHandlerOnKeyDown RemoveHandlerOnMouseWheel RemoveHandlerOnResize RemoveHandlerOnVisibleChanged RemoveHandlerOnVisibleChanging ReplaceDockedControl RequestAlign Resize Scale96ToFont Scale96ToForm Scale96ToScreen ScaleConstraints ScaleDesignToForm ScaleFontsPPI ScaleFontTo96 ScaleFontToScreen ScaleFormTo96 ScaleFormToDesign ScaleScreenTo96 ScaleScreenToFont ScreenToClient ScreenToControl SendToBack SessionProperties SetAction SetAlign SetAnchors SetAutoSize SetBiDiMode SetBoundsKeepBase SetCursor SetDragMode SetEnabled SetHint SetInitialBounds SetName SetParent SetParentBackground SetParentBiDiMode SetParentComponent SetTextBuf SetVisible SetZOrder ShouldAutoAdjust Show ShowHelp TBDockHeight Text TextChanged Top TripleClick UndockHeight UndockWidth UpdateAnchorRules UpdateBaseBounds UpdateMouseCursor UpdateRolesForForm UseRightToLeftAlignment UseRightToLeftReading UseRightToLeftScrollBar VisibleChanged VisibleChanging Width WidthIsAnchored WindowProc WMCancelMode WMLButtonDBLCLK WMLButtonDown WMLButtonQuadCLK WMLButtonTripleCLK WMLButtonUp WMMButtonDBLCLK WMMButtonDown WMMButtonQuadCLK WMMButtonTripleCLK WMMButtonUp WMMouseHWheel WMMouseMove WMMouseWheel WMRButtonDBLCLK WMRButtonDown WMRButtonQuadCLK WMRButtonTripleCLK WMRButtonUp WMXButtonDBLCLK WMXButtonDown WMXButtonQuadCLK WMXButtonTripleCLK WMXButtonUp

From TLCLComponent (6)

DecLCLRefCount GetWSComponentClass IncLCLRefCount LCLRefCount NewInstance WidgetSetClass

From TComponent (64)

_AddRef _Release CanObserve ChangeName ComObject ComponentCount ComponentIndex Components ComponentState ComponentStyle DesignInfo DestroyComponents Destroying ExecuteAction FindComponent FreeNotification FreeOnRelease GetChildOwner GetChildParent GetDeltaStreams GetEnumerator GetIDsOfNames GetNamePath GetObservers GetOwner GetTypeInfo GetTypeInfoCount iicrGetComponent InsertComponent Invoke IsImplementorOf Loading Name ObserverAdded Observers OnGetDeltaStreams Owner PaletteCreated QueryInterface ReadDeltaState ReadDeltaStream ReferenceInterface RemoveComponent RemoveFreeNotification RemoveFreeNotifications SafeCallException SetAncestor SetChildOrder SetDesigning SetDesignInstance SetInline SetSubComponent Tag ToString TToStringNameMode UpdateAction Updated UpdateRegistry Updating ValidateContainer ValidateInsert ValidateRename VCLComObject WriteState

From TPersistent (4)

Assign FPOAttachObserver FPODetachObserver FPONotifyObservers

From TObject (35)

AfterConstruction CheckDisposed ClassInfo ClassName ClassNameIs ClassParent ClassType CleanupInstance DefaultHandlerStr Dispatch DispatchStr Disposed DisposeOf Equals FieldAddress Free FreeInstance GetDisposed GetHashCode GetInterface GetInterfaceByStr GetInterfaceEntry GetInterfaceEntryByStr GetInterfaceTable GetInterfaceWeak GetLastCastErrorInfo InheritsFrom InitInstance InstanceSize MethodAddress MethodName QualifiedClassName StringMessageTable SystemHasExtendedRTTI UnitName

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.