> dear all; when TListView is custom drawn/painted,
> the underlying native control has no clue about
> how it is done, and it calculates the length of
> text metrics for the TListItem.Caption (and
> TListItem.SubItems.Text) strings based on the
> control's default params.
It is based on the width of the columns.
> drop a TListView, make it look like a report and populate
> a few items with captions long enough to not fit the
> column width; hover the mouse over such a long item or
> subitem and you will see the hint is displayed showing that
> text in full length.
As it should be.
> If you custom draw these captions in narrow font, the
> underlying native still shows the hints. I'm looking for a
> VCL-based solution instead of intercepting internal control
Try using the TListView.OnInfoTip event (which is triggered by the LVN_GETINFOTIP
notification) to manage the text of the toolhint. If the tooltip is being
displayed for a TListItem whose text is not "too long", set the event's InfoTip
parameter to an empty string. If that does not solve your issue, you will
have to handle the LVN_GETINFOTIP notification directly (which you should
do anyway, as it provides you with the subitem being displayed, which the
OnInfoTip event does not tell you).
Remy Lebeau (TeamB)