![]() |
entertaste als char?????
hi ich will dies aufrufen
edit1.OnKeyPress(sender,#13); und will als 2tes argument die enter taste reinbringen, aber dies scheint so nicht zu funktionieren? warum denn wie is dann richtig, danke |
Re: entertaste als char?????
ähm...tut mir leid, meine Glaskugel ist zu Hause. Gibts eine Fehlermeldung oder was?
Greetz alcaeus |
Re: entertaste als char?????
Einen Fehler gibt es auf jeden Fall. Weil Key als var im OnKeyPress Ereignis deklariert ist. Aber ich verstehe den Sinn irgendwie nicht.
|
Re: entertaste als char?????
On
Zitat:
Delphi-Quellcode:
Deshalb:
TKeyPressEvent = procedure (Sender: TObject; var Key: Char);
Delphi-Quellcode:
@Sprint: der Sinn ist, dass man im OnKeyPress die Taste verändern darf;
var
taste : char; begin taste := #13; if Assigned(edit1.OnKeyPress) then // <== ohne diese Zeile kann es dich auf die S@@@@@@ hauen edit1.OnKeyPress(sender, taste); end; die veränderte Taste geht an das Control
Delphi-Quellcode:
procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);
begin if not (Key in ['0'..'9']) then Key := #0; // Tastendruck "schlucken" end; |
Re: entertaste als char?????
Zitat:
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 13:03 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