I'm trying to hide the border (focus rectangle) which Delphi draws around the currently selected cell in a StringGrid. I'm doing owner drawing to customize the appearance of the string grid. I've managed to get rid of everything but the selection.
I was using
GR.Left := -1;
GR.Top := -1;
GR.Right := -1;
GR.Bottom := -1;
StringGrid.Selection := GR;
But that gives errors if you set this really fast (I have this running in onMouseMove). What I mean by that is it works fine, but if I call this particular chunk of code fast enough I get an exception in the rendering of the StringGrid (thus I can't just chuck an try except around it).
Any ideas on how I can solve this reliably?