我可以轻松双击我的字符串网格并使用VCL应用程序获取单元格的内容。如何使用FMX执行此操作?

时间:2018-11-07 21:43:59

标签: delphi mouse firemonkey

我使用此代码能够单击网格中的某个单元格,并能够在该单元格中输出字符串。在我的VCL应用程序中,它工作得很好。

procedure TForm1.StringGridBindSourceDB1CellDblClick(const Column: TColumn;
  const Row: Integer);


var
  Coordinates:TGridCoord;
  x:integer;
  Pt:TPoint;
  html_body:string;
  ClickCol:Integer;
  ClickRow:Integer;
begin
  Pt := grid.ScreenToClient(mouse.CursorPos);
  Coordinates := grid.MouseCoord(Pt.X, Pt.Y);

  ClickCol := Coordinates.X;
  ClickRow := Coordinates.Y;
  html_body := grid.Cells[ClickCol, ClickRow];
end;

但是,当我尝试在firemonkey应用程序中获得相同的结果时,我无法使用“ TGridCood”,“ ScreenToClient”或“ mouse.CursorPos

grid”是TStringGrid

0 个答案:

没有答案