RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TCustomListView.OnCustomDrawSubItem Event

Occurs when a subitem must be rendered in an owner-draw list view.

Pascal
property OnCustomDrawSubItem: TLVCustomDrawSubItemEvent;
C++
__property TLVCustomDrawSubItemEvent OnCustomDrawSubItem;

Write code in an OnCustomDrawSubItem handler to draw to the subitems that appear in additional columns to the right of each item when ViewStyle is vsReport. Use the list view's Canvas property as a drawing surface. Unlike the OnDrawItem event, the list view receives this event even if the OwnerDraw property is false.  

The Sender Parameter specifies the list view that owns the subitems. The Item parameter is the current Item being drawn. The SubItem parameter is the index of the subitem of that list item in its SubItems property. The State property indicates various attributes that can affect the way the subitem is drawn. Set DefaultDraw to False to prevent the list view from adding the subitem's text after the event handler exits.

Note: OnCustomDrawSubItem occurs immediately prior to the rendering of each subitem. To augment the default drawing process at other stages (such as after the subitem is drawn), use the OnAdvancedCustomDrawSubItem event instead.
 

 

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!