1. 程式人生 > >CxGrid鼠標移到更改顏色

CxGrid鼠標移到更改顏色

lec nil tst get int election for 顏色 obj

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;

CxGrid鼠標移到更改顏色