How to get DBGrid Cell coordinates

The code to show over what cell in a DBGrid the cursor is, and how to change the cursor over the tite bar: ~~~~~~~~~~~~~~~~~~~~~~~~~
procedure TForm1.GridMouseMove
  (Sender: TObject; Shift: TShiftState; X, Y: Integer) ;
var
   pt: TGridcoord;
begin
  pt:= Grid.MouseCoord( x, y ) ;

  //change the cursor whe over title
  if pt.y=0 then
    Grid.Cursor:=crHandPoint
  else
    Grid.Cursor:=crDefault;

   If pt.X > 0 Then
     Caption := Format( 'col: %d, row: %d, title: %s',
                [pt.x, pt.y, Grid.columns[pt.x-1].title.caption] )
   Else
     Caption := Format( 'col: %d, row: %d',[pt.x, pt.y] ) ;
end;
~~~~~~ 

おすすめ

転載: blog.csdn.net/shaken/article/details/1701928