procedure TForm1.DBGrid1MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
mouse_event(MOUSEEVENTF_RIGHTDOWN, 0, 0, 0, 0 );
mouse_event(MOUSEEVENTF_RIGHTUP, 0, 0, 0, 0 );
end;
这样马马虎虎,好象都能鼠标移到某个cell上面,相应文字改变颜色的效果,
如果要一行,还得改。
procedure TForm1.DBGrid1DrawColumnCell(Sender: TObject; const Rect: TRect;
DataCol: Integer; Column: TColumn; State: TGridDrawState);
begin
IF (gdSelected in State) then
begin
DBGrid1.Canvas.Font.Color := clRed;
DBGrid1.Canvas.Font.Style := [fsItalic];
end;
DBGrid1.DefaultDrawColumnCell(Rect, DataCol, Column, State);
end;