Autor Beitrag
skaven
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 41



BeitragVerfasst: Mi 01.12.04 11:21 
Hallo zusammen,

ich benutze zwei tmaskedit fenster. ich würde gerne in dem ersten ein zahl eingeben, nach vollständiger eingabe, einter drücken, die darin stehende zahl überprüfen, falls falsch, neue eingabe erzwingen, fals richtig, automatisch ins zweite tmaskedit fenster springen.
Hab es mal mit dem ereignis on exit versucht, aber irgendwie ist es nicht das was ich suche.

wer hat eine idee?

Moderiert von user profile iconKlabautermann: Topic aus Sonstiges verschoben am Mi 01.12.2004 um 11:36
Moderiert von user profile iconTino: Titel geändert.
cartridge
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 209

Win XP
D4 Prof,D6 Prof
BeitragVerfasst: Do 02.12.04 23:01 
Hi Kollege!

Da müsstest Du erstmal erklären, warum das mit dem OnEnter nicht das richtige ist...

Gruß
Ingo
cartridge
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 209

Win XP
D4 Prof,D6 Prof
BeitragVerfasst: Do 02.12.04 23:04 
Sorry!

OnExit meinte ich.

Wenn Du allerdings mit der ENTER- Teste in das nächste Feld wechseln willst, musst Du folgenden Code verwenden:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
procedure TAuftrag_neu.FormKeyPress(Sender: TObject; var Key: Char);
begin
  if (AMSy_Consts.Optionen.Feldwechsel) and (Key = #13) then
    Self.Perform(WM_NEXTDLGCTL,0,0);
  if Key = #13 then Key:= #0;
end;


Du musst zusätzlich in der Form Keypreview auf true setzen!

Gruß
Ingo
cartridge
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 209

Win XP
D4 Prof,D6 Prof
BeitragVerfasst: Do 02.12.04 23:06 
Irgendwie bin ich wirr...

Mit diesem Code konntest Du evtl nicht viel anfangen, weil ich eigene Deklarationen verwendet habe. Daher noch einmal neutral:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
procedure TAuftrag_neu.FormKeyPress(Sender: TObject; var Key: Char);
begin
  if (Key = #13) then  //wenn ENTER gedrückt
    Self.Perform(WM_NEXTDLGCTL,0,0);
  if Key = #13 then Key:= #0;  //Taste "neutralisieren"
end;