Autor Beitrag
CenBells
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1547

Win 7
Delphi XE5 Pro
BeitragVerfasst: Di 12.11.02 21:20 
Hallo Leute.

Ich habe ein TEdit feld und möchte mit einem Druck auf enter zur nächsten Control springen.
Das mache ich mit folgendem Code.

ausblenden Quelltext
1:
2:
3:
4:
5:
6:
procedure TMyForm.vEditBeschreibungKeyPress(Sender: TObject;
  var Key: Char);
begin
  if key = #13 then
    FocusControl(vEditBetrag);
end;


Der Code funktioniert auch einwandfrei.
Aber wenn ich nun ein enter in dem Edit feld drücke, ertönt auch der Standartwarnton von windows.
Wahrscheinlich, weil Enter in edits nicht zugelassen ist. Wie kann ich nun aber verhindern, das der ton ausgegeben wird?

Danke und Gruß
Ken
CenBells Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1547

Win 7
Delphi XE5 Pro
BeitragVerfasst: Di 12.11.02 21:35 
oh, habe es schon behoben trotzdem danke an alle

ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
procedure TMyForm.vEditBeschreibungKeyPress(Sender: TObject; 
  var Key: Char); 
begin 
  if key = #13 then begin
    FocusControl(vEditBetrag); 
    key = #0;
  end;
end;


Gruß
Ken