![]() |
OnClick bei wechseln der Zelle im StringGrid ?
Hi,
warum wird im folgenden Fall bei Drücken von #13 das Onclick ausglöst ? :shock:
Delphi-Quellcode:
Drücke ich Return, so sehe ich "222". 8)
procedure TForm1.StringGrid1Click(Sender: TObject);
begin showmessage ('222'); end; procedure TForm1.StringGrid1KeyPress(Sender: TObject; var Key: Char); begin if key = #13 then StringGrid1.Col := StringGrid1.Col + 1; end; |
Re: OnClick bei wechseln der Zelle im StringGrid ?
Hai Hansa,
das ist genauso wie z.B. bei einem TListView. OnClick wird immer dann ausgelöst wenn eine andere Spalte/Zeile aktiv wird. Es hat also nichts mit einem Mausklick zu tun. Bei einem Button wir ja auch das OnClick ausgelöst wenn Du dort die Space-Taste drückst. |
Re: OnClick bei wechseln der Zelle im StringGrid ?
Zitat:
<Edit>Stimmt nicht, also vergiss es.</Edit>
Delphi-Quellcode:
procedure TForm1.StringGrid1KeyPress(Sender: TObject; var Key: Char);
begin if key = #13 then begin StringGrid1.Col := StringGrid1.Col + 1; key := #0; // <--- end; end; |
Alle Zeitangaben in WEZ +1. Es ist jetzt 14: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