I have a tstringgrid on a form which uses this code to highlight a selected row:
procedure TTestForm.testGridDrawCell(Sender: TObject; ACol,
ARow: Integer; Rect: TRect; State: TGridDrawState);
begin
testGrid.Canvas.Pen.Color := clNone;
if ARow <> SelectedRow then
testGrid.Canvas.Brush.Color := clWindow
else testGrid.Canvas.Brush.Color := clActiveCaption;
if ColorTSTringList[ARow] = 'Red' then
testGrid.Canvas.Font.Color := clRed;
testGrid.Canvas.Rectangle(Rect.Left, Rect.Top, Rect.Right, Rect.Bottom);
testGrid.Canvas.TextRect(Rect, Rect.Left,Rect.Top,testGrid.Cells[ACol,ARow]);
end;
For some reason, there is a slightly darker blue rectangle, perhaps 3 pixels wide and the height of the cell in each row which is highlighted (see attached image). Any ideas on this one?