CxGrid鼠标移上时更改颜色并改变记录焦点

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;


联系电话:
020-00000000
联系电话:
020-00000000
联系电话:
020-12345678