![]() |
TStringGrid, Doppelklick auf fixed Row ignorieren
Halo#,
irgendwie stehe ich auf dem Schlauch. Der folgende Code soll beim Doppelklick auf eine Zelle das DoEdit aufrufen, ausser beim Doppelklick auf die FixRow.
Delphi-Quellcode:
Klappt aber nicht ;(
procedure TForm1.GridDataDblClick(Sender: TObject);
var iCol: Integer; iRow: Integer; Point: TPoint; begin Point.X:= Mouse.CursorPos.X; Point.Y:= Mouse.CursorPos.X; Point:= GridData.ScreenToClient(Point); GridData.MouseToCell(Point.X, Point.Y, iCol, iRow); if iRow<1 then Exit; DoEdit; // das eigentliche Editieren end; iCol und iRow ergeben immer -1 ??? Was mache ich verkehrt ? Danke Heiko |
AW: TStringGrid, Doppelklick auf fixed Row ignorieren
Delphi-Quellcode:
Klappt bei mir so ;)
procedure TfrmTest.StringGrid1DblClick(Sender: TObject);
var p: TPoint; aCol, aRow: integer; begin p := StringGrid1.ScreenToClient(Mouse.CursorPos); StringGrid1.MouseToCell(p.X,p.Y,aCol,aRow); if aRow < StringGrid1.FixedRows then begin if aRow < 0 then ShowMessage('Keine Zelle an dieser Stelle') else ShowMessage('Fixe Zeile geklickt'); end; end; |
AW: TStringGrid, Doppelklick auf fixed Row ignorieren
Hallo,
Point.X:= Mouse.CursorPos.X; Point.Y:= Mouse.CursorPos.Y; Und das <0 auf <1 ändern ... Das war mein Fehler ;) Danke Heiko |
Alle Zeitangaben in WEZ +1. Es ist jetzt 02:09 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz