CxGrid 鼠标悬停显示窗体

procedure TForm1.cxGrid1DBCardView1MouseMove(Sender: TObject;

 Shift: TShiftState; X, Y: Integer);

Var

 AHitTest: TcxCustomGridHitTest;

 ATrackItem: TcxCustomGridTableItem;

 ATrackRec: TcxCustomGridRecord;

begin

 if  (X + Form_alt.Width) >  SCREEN.WIDTH then

   Form_alt.Left :=  X - Form_alt.Width-15

 else

   Form_alt.Left := X+15;


 if  (Y + Form_alt.Height + 180) >  SCREEN.HEIGHT then

   Form_alt.Top :=  Y - Form_alt.Height+90

 else

   Form_alt.Top := Y+110;

 AHitTest := (Sender as TcxGridSite).GridView.ViewInfo.GetHitTest(X, Y);

 if AHitTest is TcxGridRecordCellHitTest then

 begin

   ATrackItem := TcxGridRecordCellHitTest(AHitTest).Item;

   ATrackRec := TcxGridRecordCellHitTest(AHitTest).GridRecord;

   Form_alt.PID := varToStr(ATrackRec.Values[0]);

   Form_alt.Show;

 end

 else

   Form_alt.Close;

end;


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