![]() |
Bei Enter ins nächste EDIT-Feld
Hallo allerseits,
habe eine Form mit mehreren Edits, Buttons, etc ... Die Tabulator-Reihenfolge ist gemischt ... Ich möchte folgendes erreichen: Bei Enter in einem Edit-Feld soll auf das nächste Edit-Feld gesprungen werden (nicht auf einen Button o.ä.) Ist man im letzten Edit soll wieder aufs erste gegangen werden. Jedoch möchte ich weiterhin die Möglichkeit haben, wenn ich TAB drücke das der Focous dann aufs nächste Control( z.B. Button) geht. Irgendwelche Vorschläge ??? Grüsse Steve |
Re: Bei Enter ins nächste EDIT-Feld
Hallo burn
Code:
KeyPreview von Form1 auf true setzen nicht vergessen!!!
procedure TForm1.FormKeyPress(Sender: TObject; var Key: Char);
begin if Key = #13 then Self.Perform(WM_NEXTDLGCTL, 0, 0); end; Gruß Bernd |
Re: Bei Enter ins nächste EDIT-Feld
Delphi-Quellcode:
procedure TForm1.Edit1KeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState); var NextControl: TWinControl; begin if Key = VK_RETURN then begin NextControl := Sender as TWinControl; repeat NextControl := FindNextControl(NextControl, True, True, True); until NextControl.InheritsFrom(TEdit); NextControl.SetFocus; end; end; |
Re: Bei Enter ins nächste EDIT-Feld
... hallo ...
wie wäre es mit dem onkey.. ereignis ... |
Re: Bei Enter ins nächste EDIT-Feld
Thx to Stevie -> funzt bestens, genau das hab ich gesucht!!!
@bernd2000 -> die Möglichkeit hatte ich auch zuerst aber ich bin immer nur im nächsten Control gelandet Vielen Dank für die Mithilfe Steve |
Alle Zeitangaben in WEZ +1. Es ist jetzt 10:27 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