Autor Beitrag
Nagelbrett
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 75



BeitragVerfasst: Mo 19.05.03 16:08 
hi, ich hab ein normales einzeiliges edit-feld und möchte gern, dass wenn jemand enter da drückt, die eingabe ausgewertet wird...

wenn ich jetzt im OnKeyDown mit if key = ... das ganze mache, dann funktioniert das zwar, aber es kommt immer ein "ding" (also der windows standard sound), weil man in einer einzeiligen editbox ja nicht enter drücken kann (bzw nicht eine zeile weiterspringen kann)

wie kann ich jetzt verhindern, dass er immer diesen sound spielt?
mit Key := 0; am ende der prozedur gehts leider nicht...
hab auch schon OnKeyPress probiert, aber da ist's das selbe
ErnestoChe
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 528

Win 2000 pro, CRUX 2.0
Delphi 6 Pers, Open K3
BeitragVerfasst: Mo 19.05.03 16:57 
Hi,

dann mach so:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);
begin
  if key = #13 then
  begin
    key:= #0;             //  <-------------------------------------------
    caption := edit1.Text;
  end;
end;



MFG

- Ernesto -
Nagelbrett Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 75



BeitragVerfasst: Di 20.05.03 12:24 
ja stimmt, danke

das funktioniert :)

aber in KeyDown war Key leider kein Char sondern Word, naja, egal, habs jetz mit KeyPress gemacht