Mastodon
Programmierung

ListView OnCustomDrawSubItem

Richard Sutcliffe wrote:

> Can anyone show me how I can get OnCustomDrawSubItem to work? I have a
> standard report style TListView which shows filenames and icons in the
> caption/first column and I wish to display the file folder and assoiated
> graphic in the first subitem and a checkbox icon in the second. I added
> code to do this to the CustomDrawSubItem event, however it didn’t work –
> I ensured DefaultDraw was false and stepped through my code to find that
> the event isn’t even fired off.
>
> Is there a property I need to set to force OnCustomDrawSubItem to be
> used?
>
> Thanks in advance
>
> Richard Sutcliffe
> mailto:
rsutcliffe@bigfoot.com

Two things are needed:
1. The control’s OwnerDraw property must be False (this seems odd, but owner
draw and custom draw aren’t the same).
2. There must be an assigned OnCustomDrawItem handler. This doesn’t need to
do anything, however, and in partricular it must NOT set DefaultDraw to be
False.

Chris Jobson
RCP Consultants Ltd.

[tags]Delphi, Components, ListView[/tags]

0 Kommentare zu “ListView OnCustomDrawSubItem

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht.