![]() |
TEdit Eingabe mit Entertaste abschliessen
Ich gebe bei einem TEdit was ein und schliesse die Eingabe mit Enter ab dann ertönt der Windows Sound 'Ding'. Wie kann ich das verhindern? Die Enter Eingabe habe ich abgefangen um die nächste Aktion auszulösen. Der Ton 'Ding' ertönt trotzdem. Welche Eigenschaften bei Form oder Edit muss ich machen dass kein Ton ertönt?
Vielen Dank für die Antworten - Netpilots |
AW: TEdit Eingabe mit Entertaste abschliessen
Zitat:
|
AW: TEdit Eingabe mit Entertaste abschliessen
Hallo,
OnEdit1KeyPress if Key=#13 then Key := #0; Heiko |
AW: TEdit Eingabe mit Entertaste abschliessen
Vielen Dank, das funktioniert ja super.
|
AW: TEdit Eingabe mit Entertaste abschliessen
Damit das im ganzen Formular funktioniert, kann man es auch in FormKeyDown einbauen.
Delphi-Quellcode:
procedure TLagerCustomForm.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState); var Msg : TMsg; begin if (key = VK_RETURN) and (shift = [])then begin if not IsOpenDropDown then // Kein Ersetzen wenn ein Dropdown offen ist begin Key := 0; PeekMessage(Msg, 0, WM_CHAR, WM_CHAR, PM_REMOVE); Perform(WM_NEXTDLGCTL,0,0); end; end; end; function TLagerCustomForm.IsOpenDropDown: boolean; var i : integer; begin result := false; for i := 0 to ControlCount -1 do begin with Controls[i] do begin // Abfrage auf Devexpress und VCL Combobox if (InheritsFrom(TcxCustomDropDownEdit) and TcxCustomDropDownEdit(Controls[i]).DroppedDown) or (InheritsFrom(TCustomComboBox) and TCustomCombo(Controls[i]).DroppedDown) then begin result := true; break; end; end; end; end; |
Alle Zeitangaben in WEZ +1. Es ist jetzt 22:03 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz