Autor Beitrag
buster
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 66
Erhaltene Danke: 7

WIN 7
Delphi 2010 Prof
BeitragVerfasst: Di 14.12.04 15:38 
Hallo,

ich habe folgendes Problem:

ich möchte in Editfenstern Werte eingeben, danach mit ENTER bestätigen und dann automatisch beim nächsten Tabstop landen. Habe schon diese Prozedur geschrieben

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
procedure TForm1.FormKeyPress(Sender: TObject; var Key: Char);
begin if key = #13 then
  begin
    Perform(WM_NEXTDLGCTL, 0, 0); //bei ENTER wird zum naechsten Feld geschaltet
    key := #0;
  end;
end;


Das klappt aber nur, wenn beim Edit 'only numeric Values' auf false gesetzt ist... :(
Geht das auch irgendwie bei Zahleneingaben?

Grüßle,
Buster 8)

_________________
die groessten Kritiker der Elche waren frueher selber welche... ;)
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Di 14.12.04 16:07 
Was hast du für ein Edit? Das standard TEdit der VCL hat diese Eigenschaft nicht - zu mindest nicht unter Delphi 6 Personal.
Ja-Pa
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 458

Win XP, Suse 9.3
D1, D3, D5 Std, D7 Pro, D2005 Pers, Kylix 3
BeitragVerfasst: Di 14.12.04 16:11 
Naja, die Entertaste ist nunmal kein numerischer Wert :wink:
Kann man das nicht auch in das Form-Ereignis statt in das Edit.OnKeyPress-Ereignis schreiben?
Das sollte dann nämlich gehen...

_________________
Der Autor dieses Textes haftet nicht für Schäden an Soft- oder Hardware
oder Vermögensschäden, die durch das Benutzen des Textes entstehen.
GSE
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 740

Win 2k, Win XP Pro
D5 Prof, D6 Ent, D2k5 PE
BeitragVerfasst: Di 14.12.04 16:14 
dann muss er aber noch KeyPreview der Form auf true setzen

mfg
GSE

_________________
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs
and the universe trying to produce bigger and better idiots. So far, the universe is winning. (Richard Cook)
rochus
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 416

Win XP Prof, Fedora Core 4, SuSE 7.0
D7 Ent, D2005 Pers
BeitragVerfasst: Di 14.12.04 17:18 
Im OnFormShortCut kann man sowas auch abfangen. Außerdem könnte man sich das ereignis WM_GETDLGCODE abfangen, bin mir aber nicht sicher ob da die Enter-Taste mit drin ist, oder ob man sich daraufhin nur z.B. TAB abfangen kann.

gruß
rochus

_________________
Im Nachhinein ist man immer ein Schlauch!
"Dream as if you'll live forever, live as if you'll die today!" James Dean
buster Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 66
Erhaltene Danke: 7

WIN 7
Delphi 2010 Prof
BeitragVerfasst: Mi 15.12.04 08:09 
Ja, danke...
das mit dem KeyPreview war es... jetzt funktionierts :D

_________________
die groessten Kritiker der Elche waren frueher selber welche... ;)