Board index » delphi » Beep when enter key pressed in DBEditBox

Beep when enter key pressed in DBEditBox

Can anybody explain:

When a DBEditBox has the focus, and I press enter, the computer beeps.
Why does this happen?

 

Re:Beep when enter key pressed in DBEditBox


Quote
In article <34C76243.5...@up.ac.za>,  wrote:
> When a DBEditBox has the focus, and I press enter, the computer beeps.
> Why does this happen?

Windows standard behavior: Enter means to press the form's default
button.  

If the form does not have a default button, it will beep.  If you're
trying to move the next field, TAB is the proper key.

Re:Beep when enter key pressed in DBEditBox


You can avoid this by setting the form's KeyPress property to true, and by
coding a KeyPress handler for the form that includes the following statement
:

if Key = #13 then Key := #0 ;

so that the Enter key will be eaten, and Windows will not see it : so no
beep.

Regards
Eric

e...@up.ac.za a crit dans le message <34C76243.5...@up.ac.za>...

Quote
>Can anybody explain:

>When a DBEditBox has the focus, and I press enter, the computer beeps.
>Why does this happen?

Other Threads