Autor Beitrag
Ottchen
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 43



BeitragVerfasst: Do 29.08.02 19:59 
Hallo Liste,

ich finde es lästig, nur mit der Tab-Taste von einem Edit-
Feld in das nächste zu gelangen. Funktioniert das auch mit der ENTER-Taste? Am Besten von einem Eingabe-Edit-Feld zum nächsten und dann zu einem Button.

Weiß jmd. wie man so etwas programmiert?

Danke. Ottchen

_________________
See you.
Arakis
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 344



BeitragVerfasst: Do 29.08.02 20:06 
Hi Ottchen user defined image,

Du musst dem onKeyPress-Ereignis des Edit-Feldes folgende prozedur zuweisen:
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
procedure TForm_Edit.KeyPress(Sender: TObject; var Key: Char);
begin
  if key = #13 then
  begin
    Self.Perform(WM_NEXTDLGCTL, 0, 0);
    key := #0;
  end;
end;


Bis dann
user defined image

_________________
Mit dem Computer löst man Probleme, die man ohne ihn nicht hätte.
Entwickler von SpaceTrek: The New Empire - Siehe Hompage!
Tino
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Veteran
Beiträge: 9839
Erhaltene Danke: 45

Windows 8.1
Delphi XE4
BeitragVerfasst: Do 29.08.02 21:57 
Ich würde den Code von Arakis in das OnKeyPress-Event des Forms packen. Damit wird es dann gleich mit jedem Control auf dem Form funktionieren. Nicht vergessen KeyPreview auf True zu setzen.

TINO
Ottchen Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 43



BeitragVerfasst: Mi 04.09.02 19:58 
Titel: Es funktioniert nicht
Vielen Dank erst einmal euch beiden,

ich habe beide Varianten ausprobiert und es funktioniert immer noch nicht. Lege ich eine neues Formular mit Edit-Feldern an, klappt es. Aber ich möchte den Quelltext in mein (einfaches) Programm einbinden. Gibt es noch eine andere Möglichkeit oder kann ich das Programm zur "Besichtigung" irgendwo uploaden?

Ottchen

_________________
See you.
Arakis
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 344



BeitragVerfasst: Mi 04.09.02 20:00 
Du kannst es mir einfach per Mail schicken, wenn du möchtest :wink:

Bis dann,
user defined image

_________________
Mit dem Computer löst man Probleme, die man ohne ihn nicht hätte.
Entwickler von SpaceTrek: The New Empire - Siehe Hompage!