| View previous topic :: View next topic |
| Author |
Message |
Constantine Hvan Guest
|
Posted: Wed Jul 30, 2003 11:53 am Post subject: sound in TEdit |
|
|
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.
|
|
| Back to top |
|
 |
JD Guest
|
Posted: Wed Jul 30, 2003 12:07 pm Post subject: Re: sound in TEdit |
|
|
"Constantine Hvan" <cvh (AT) sunbay (DOT) 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
|
|
| Back to top |
|
 |
Hans Galema Guest
|
Posted: Wed Jul 30, 2003 12:14 pm Post subject: 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.
|
|
| Back to top |
|
 |
Constantine Hvan Guest
|
Posted: Wed Jul 30, 2003 12:50 pm Post subject: 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.
|
|
| Back to top |
|
 |
JD Guest
|
Posted: Wed Jul 30, 2003 12:56 pm Post subject: Re: sound in TEdit |
|
|
"Constantine Hvan" <cvh (AT) sunbay (DOT) com> wrote:
| Quote: | Yes! But obviously you had in mind OnKeyPress event.
|
Must be time for bed.
~ JD
|
|
| Back to top |
|
 |
Hans Galema Guest
|
Posted: Wed Jul 30, 2003 12:58 pm Post subject: 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.
|
|
| Back to top |
|
 |
Jonathan Arnold Guest
|
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Wed Jul 30, 2003 4:57 pm Post subject: Re: sound in TEdit |
|
|
"JD" <nospam (AT) nospam (DOT) com> wrote
| 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
|
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Wed Jul 30, 2003 4:58 pm Post subject: Re: sound in TEdit |
|
|
"Hans Galema" <j.m.galema.dontusethis (AT) maartens (DOT) nl> wrote
| 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
|
|
| Back to top |
|
 |
Constantine Hvan Guest
|
Posted: Thu Jul 31, 2003 8:57 am Post subject: 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.
|
|
| Back to top |
|
 |
|