Autor Beitrag
Éde1987
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 24



BeitragVerfasst: Sa 06.01.07 13:37 
Hallo alle miteinander...
ich wollte mal fragen ob man mit den Ereignis On Key Press den Coursor in ein anderes Feld springen lassen kann. Damit meine ich:

Erstes Edit-Fenster: Eingabe eines Buchstabens (Bsp. "A")

--> nun soll der Coursor automatisch ins zweite Edit-Fenster hüpfen, damit ich da denn auch was eingeben kann ohne mit meiner Maus erst ins zweite Edit-Fenster zu drücken.

Gibt es dafür ein Befehl oder eine Anweisung?

Danke schonmal an alle brauchbaren Antworten!!!
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8554
Erhaltene Danke: 481

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Sa 06.01.07 13:46 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);
begin
  if key = 'a' then ActiveControl := Edit2;
end;

_________________
We are, we were and will not be.
Jakob Schöttl
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 929
Erhaltene Danke: 1


Delphi 7 Professional
BeitragVerfasst: Sa 06.01.07 13:51 
ja, ich würde das OnKeyPress machen: wenn Key = 'a' dann Taste drücken (Tab)

auf delphi:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
if Key = 'a' then begin
  keybd_event(VK_TAB,0,0,0);
  keybd_event(VK_TAB,0,KeyEventF_KeyUp,0);
end;


wenn dus so machst, dann kannst du auch mehr als 2 Edits haben...
Éde1987 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 24



BeitragVerfasst: Sa 06.01.07 13:51 
Ich danke dir viel mals (oder wie auch immer die richtige Rechtschreibung ist) ^^