Thema: Delphi DBGrid / Popup-Menü

Einzelnen Beitrag anzeigen

Benutzerbild von KodeZwerg
KodeZwerg

Registriert seit: 1. Feb 2018
3.685 Beiträge
 
Delphi 11 Alexandria
 
#7

AW: DBGrid / Popup-Menü

  Alt 21. Feb 2021, 22:15
Das mit den koordinaten ist etwas tricky.
Hier (SO) schau mal rein, die akzeptierte Antwort funktioniert hoffentlich noch.

Hier eine Kopie der Lösung.

Delphi-Quellcode:
// implementation

type
  THackDBGrid=class(TDBGrid);

// Where you need the coordinates
var
  CurrRow: Integer;
  Rect: TRect;
begin
  CurrRow := THackDBGrid(DBGrid1).Row;
  Rect := THackDBGrid(DBGrid1).CellRect(ColIndexYouWant, CurrRow);
// Rect now contains the screen coordinates you need, or an empty
// rectangle if there is no cell at the col and row specified.
end;
Gruß vom KodeZwerg

Geändert von KodeZwerg (21. Feb 2021 um 22:22 Uhr)
  Mit Zitat antworten Zitat