程式碼如下:
procedure TFMain.dbgMastrDrawColumnCell(Sender: TObject; const Rect: TRect;
DataCol: Integer; Column: TColumn; State: TGridDrawState);
begin
// 遊標所停留的資料列反白
with TStringGrid(dbgMastr) do begin
if row = MouseCoord(Rect.Left+1, Rect.Top+1).Y then
begin
Canvas.Brush.Color := $00C080FF; // 將反白設為粉紅色
end;
end;
TDBGrid(Sender).DefaultDrawColumnCell(Rect,DataCol,Column,State);
end;
沒有留言:
張貼留言