Subject Re: [IBO] TIB_Grid and multiselect
Author Paul Vinkenoog
Hi Ryan,

>> I think I misunderstood your question. Did you mean: make the
>> CurrentRowColor disappear? I think you'd have to write OnExit and
>> OnEntry handlers for the grid, both with a single line setting
>> CurrentRowColor to clWindow or Grid.Color upon Exit, and to your
>> chosen current-row-color upon Entry. You can point all your grids
>> to the same handlers.

> Would you believe that doesn't work? I created the two event
> handlers and at runtime the grid still draws the current row
> hightlight and still in the standard windows hightlight color.

Wait a minute... are you sure IndicateHighlight is false for the grid?
Because that's not the same as the CurrentRowColor. IndicateHighlight
uses the Windows highlight color, and it kicks in when the Grid
*loses* focus.

I just added these two handlers to an app of mine:

void __fastcall TFormStage::grLeerlingenExit(TObject *Sender)
grLeerlingen->CurrentRowColor = clWindow;

void __fastcall TFormStage::grLeerlingenEnter(TObject *Sender)
grLeerlingen->CurrentRowColor = 0x00CEFFFF;

And it works like a charm! Of course if you use it for more grids, you
must cast Sender to TIB_Grid*.

Also realize that clicking on a non-windowed control (like a
TIB_UpdateBar) doesn't take the focus away, so this will leave the
current row in CurrentRowColor (not Windows' highlight color).

Paul Vinkenoog