CxGrid鼠标移到更改颜色
设置表单中TcxGrid1DBTableView的Styles属性,设置Selection
procedure TForm1.cxGrid1DBTableView1MouseMove(Sender: TObject;
Shift: TShiftState; X, Y: Integer);
var
HitTest:TcxCustomGridHitTest;
FViewInfo:TcxGridTableDataCellViewInfo;
begin
HitTest:=cxGrid1DBTableView1.GetHitTest(X,Y);
if HitTest=nil then exit;
if HitTest is TcxGridRecordCellHitTest then
begin
FViewInfo:=TcxGridTableDataCellViewInfo(TcxGridRecordHitTest(HitTest).ViewInfo);
FViewInfo.GridRecord.Focused := true;
end
else
FViewInfo:=nil;
end;