Board index » cppbuilder » sound in TEdit

sound in TEdit


2003-07-30 07:53:45 PM
cppbuilder71
Hallo !
Not long ago I've noticed that when I press an Enter button in TEdit
component it is a sound is played (system default beep).
I'm just creating NEW form and placing ordinary TEdit component on it.
Compile and press Enter. Sound is played.
What is it? How can I turn it off?
Best regards, Constantine.
 
 

Re:sound in TEdit

"Constantine Hvan" < XXXX@XXXXX.COM >wrote:
Quote
[...] I've noticed that when I press an Enter button in TEdit
component it is a sound is played
That's default behavior. If you want to change it, you need to
intercept the key before it reaches the control.
You can do that in the Forms' OnKeyDown or the Edits' OnKeyDown
by setting the value of Key to zero.
~ JD
 

Re:sound in TEdit

JD wrote:
Quote
You can do that in the Forms' OnKeyDown or the Edits' OnKeyDown
by setting the value of Key to zero.
My experience is that assigning zero to Key produces a beep.
Hans.
 

{smallsort}

Re:sound in TEdit

Hallo !
Quote
That's default behavior. If you want to change it, you need to
intercept the key before it reaches the control.

You can do that in the Forms' OnKeyDown or the Edits' OnKeyDown
by setting the value of Key to zero.
Yes! But obviously you had in mind OnKeyPress event.
Thank you!
Best regards, Constantine.
 

Re:sound in TEdit

"Constantine Hvan" < XXXX@XXXXX.COM >wrote:
Quote
Yes! But obviously you had in mind OnKeyPress event.
Must be time for bed.
~ JD
 

Re:sound in TEdit

JD wrote:
Quote
I don't know what to tell you. Perhaps it's something that you
remember from when you were still a rookie and unsure of what
was happening.
I'm still a rookie, just here for hardly two years.
Quote
Gambit burns me on the same type thing ALL THE
TIME !!!
<grabs head with both hands, ducks>
Oh yee, how can you bare his incessant hammering ?
Quote
It's quite common (I learned it here) and it doesn't produce a
sound. Have you tried it lately?
Yes, last week.
But I remembered bad. It only produces a beep if Key == VK_RETURN
and you set Key to zero.
But that was just the problem for Constantine Hvan ;-).
Hans.
 

Re:sound in TEdit

Constantine Hvan wrote:
Quote
I'm just creating NEW form and placing ordinary TEdit component on it.
Compile and press Enter. Sound is played.
What is it? How can I turn it off?
Create an event handler for OnKeyPress. In that event handler do something
like:
if (Key == VK_RETURN)
Key = 0;
--
Jonathan Arnold C/C++/CBuilder Keen Advice:
www.keen.com/categories/categorylist_expand.asp
Comprehensive C++Builder link site:
www.buddydog.org/C++Builder/c++builder.html
 

Re:sound in TEdit

"JD" < XXXX@XXXXX.COM >wrote in message
Quote
You can do that in the Forms' OnKeyDown or
the Edits' OnKeyDown by setting the value of
Key to zero.
Use the TEdit's OnKeyPress event instead.
Gambit
 

Re:sound in TEdit

"Hans Galema" < XXXX@XXXXX.COM >wrote in message
Quote
My experience is that assigning zero to Key produces a beep.
That means that you did not actually intercept the key correctly in the
first place, such that the default behavior was still performed. Setting a
key to 0 cancels the keystroke from being processed anymore. However, where
you intercept the key is an important detail, as different keystrokes effect
OnKeyUp/Down and OnKeyPress differently.
Gambit
 

Re:sound in TEdit

Hallo !
Quote
That's default behavior. If you want to change it, you need to
intercept the key before it reaches the control.
Now I found that Escape button makes the same effect.
I just wondering what that behavior have been performed for?
It is hinder functionality as for me.
Best regards, Constantine.