Autor Beitrag
Arne Danikowski
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 194



BeitragVerfasst: Mo 15.01.07 12:39 
Hallo,

ich bin grade angefangen ein bischen mit Delphi zu experimentieren. Also noch blutiger Anfänger.
Das Programm habe ich hier als Datei mit hochgeladen.

Ich habe folgendes Problem:

Zahlenwerten sollen in Felder eingegeben werden
wenn dann die Enter Taste betätigt wird soll zum nächsten Eingabefeld gesprungen werden.

Das ganze Funktioniert auch, nur bekomme ich jedesmal, wenn ich die Entertaste drücke einen Tastenton.

Meine Frage, kann man das verhindert??

mfg

Arne
Einloggen, um Attachments anzusehen!
aim65
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 312

Win 9x, Win XP
Delphi 3pro, 7PE
BeitragVerfasst: Mo 15.01.07 12:46 
Vielleicht reicht das hier mit einer Win-API-Funktion (Teil aus meiner Standard-Keypress Routine:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
//...
if Key =#13 then          //"CR" equal to the "TAB" Key
        begin
          Perform(WM_NEXTDLGCTL, 0, 0);  //set focus to next field
          Key := #0;                     //avoid beep tone <<<<<<<<<
        end
//..else...
Arne Danikowski Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 194



BeitragVerfasst: Mo 15.01.07 13:27 
Vielen dank das hat prima funktioniert.

Kann es sein, das ich das ausschliesslich mit der Funktion FormKeyPress machen kann?
Bei OnKeyDown und OnKeyUp dürfte das dann eigentlich nicht funktionieren oder?
aim65
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 312

Win 9x, Win XP
Delphi 3pro, 7PE
BeitragVerfasst: Mo 15.01.07 14:37 
Habe diese KeyDown/Up in diesem Zusammenhang nie benutzt. Der wesentliche Unterschied ist, dass KeyPress den Key als Char, die beiden anderen als Word zurückliefern. Setz mal in die Suche einfach "OnKeyDown" - da kriegst Du jede Menge Threads. Da ist sicher etwas dabei für Dein Problem.
Jakob Schöttl
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 929
Erhaltene Danke: 1


Delphi 7 Professional
BeitragVerfasst: Mo 15.01.07 14:58 
#13 ist im ASCII-Code ja ENTER, und bei OnKeyDown/Up gibt es einen Word mit dem Virtual-Key-Code, ich glaube da ist ENTER auch 13, aber machs lieber mit VK_RETURN.

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
if Key = VK_RETURN then          
        begin
          Perform(WM_NEXTDLGCTL, 0, 0);  //set focus to next field
          Key := 0;                     //avoid beep tone <<<<<<<<<
        end