RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TListView.OnAdvancedCustomDrawSubItem Event

Occurs at discrete stages during the painting of a subitem in an owner-drawn list view.

Pascal
property OnAdvancedCustomDrawSubItem: TLVAdvancedCustomDrawSubItemEvent;
C++
__property TLVAdvancedCustomDrawSubItemEvent OnAdvancedCustomDrawSubItem;

Write an OnCustomDrawSubItem event handler to customize the drawing of 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. OnAdvancedCustomDrawItem occurs at various stages in the rendering of a subitems. 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. 

The Stage property indicates the current stage in the painting process. Note that the cdPreErase and cdPostErase stages do not receive event notification. The background must be drawn when the item is rendered. 

DefaultDraw is only used when Stage is cdPrepaint. Set DefaultDraw to false to prevent the list view from adding the subitem's text after the event handler exits.

Note: OnAdvancedCustomDrawSubItem occurs at various stages during the paint process. If you are only writing code to execute immediately prior to rendering the subitem, it is more efficient to use the OnCustomDrawSubItem event.
 

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!