I have a default button in a form that has a TSpinEdit control on it. When the TSpinEdit control has focus and the user presses the Enter key, instead of pressing the default button, the user simply hears a system beep because the enter key is not valid for TSpinEdit.
Usually, to avoid a beep, I used the OnKeyPress event and set Key := 0 to skip a keystroke. Then I could execute the default click method. However, in this case, OnKeyPress does not start, because the Enter key is invalid.
OnKeyDown is triggered, but when I set Key := 0 there, it does not stop the system beep.
So, how do I turn off the system beep when I press the Enter key in the TSpinEdit control?
I am on Delphi 5 and they did not include the source for Spin.pas.
delphi
Marcus adams
source share