Search code examples
delphi-7dbgrid

Delphi appearance of hint when hovering the mouse in dbgrid


How to do it, what would happen when we hover the mouse cursor in dbgrid, if the field has the desired value, would a hint appear?

if qry1.fieldbyname('PASSENGER_TYPE').asstring = 'INF' then
  dbgrd1.Hint := 'младенец';

Rummaged in the properties of dbgrid made in ShowHint = True. All has earned, BUT when not on value and when I cause the cursor in dbgrid how to make that was when I am directing on value itself?


Solution

  • The best way to customize any control's hint is to either:

    1. assign an event handler to the TApplication(Events).OnShowHint event, which has HintStr and HintInfo parameters that you can customize as needed.

    2. subclass the control itself to intercept the CM_HINTSHOW message. The LPARAM will be a pointer to a THintInfo that you can customize as needed.