Autor Beitrag
Daniel07A
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 36

XP
D7 Enterprise
BeitragVerfasst: Mo 24.01.05 18:22 
Hi,

Habe folgendes Problem. Ich habe 12 Edit Felder. In jedes gibt man eine Zahl ein. Wenn ich jetzt in das 1. Edit Feld eine Zahl eingegeben habe, soll der Cursor gleich in das 2. Edit Feld springen und ich kann dort was eingeben. Und immer so weiter. Man muss das irgendwie mit setfocus hinbekommen, aber keine ahnung wie?

Und wenn ich jetzt ein button habe der die eingaben löscht, soll nachdem ich den button gecklickt habe, der cursor in das 1. edit feld springen damit ich sofort wieder die eingabe machen kann. Dazu einmal meinen Quellcode.
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
procedure TFRM_Euro.BTN_ResetClick(Sender: TObject);
begin
  EDT_Z1.Clear;
  EDT_Z2.Clear;
  EDT_Z3.Clear;
  EDT_Z4.Clear;
  EDT_Z5.Clear;
  EDT_Z6.Clear;
  EDT_Z7.Clear;
  EDT_Z8.Clear;
  EDT_Z9.Clear;
  EDT_Z10.Clear;
  EDT_Z11.Clear;
  EDT_Z12.Clear;
  EDT_Ausgabe.Clear;
  LBL_True.caption := '';

end;



Wäre nett wenn ihr beides beantworten könntet.


Moderiert von user profile iconraziel: Topic aus Sonstiges verschoben am Mo 24.01.2005 um 18:24
jasocul
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 6395
Erhaltene Danke: 149

Windows 7 + Windows 10
Sydney Prof + CE
BeitragVerfasst: Mo 24.01.05 18:41 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
procedure TFRM_Euro.BTN_ResetClick(Sender: TObject);
begin
  EDT_Z1.Clear;
  EDT_Z2.Clear;
  EDT_Z3.Clear;
  EDT_Z4.Clear;
  EDT_Z5.Clear;
  EDT_Z6.Clear;
  EDT_Z7.Clear;
  EDT_Z8.Clear;
  EDT_Z9.Clear;
  EDT_Z10.Clear;
  EDT_Z11.Clear;
  EDT_Z12.Clear;
  EDT_Ausgabe.Clear;
  LBL_True.caption := '';
  EDT_Z1.SetFocus; // So geht es;
end;

Ansonsten hast du vermutlich schon eine Eingabeprüfung im OnKeyDown-Ereignis, wenn ich mich richtig erinnere. Dort kannst du den Befehl für das passende Edit-Feld auch noch einbauen, wenn die Eingabe korrekt war.
Daniel07A Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 36

XP
D7 Enterprise
BeitragVerfasst: Di 25.01.05 14:20 
ok thx. habe es hinbekommen. mehr wollte ich auch gar nicht.

gruß daniel