BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

sound in TEdit

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Usage)
View previous topic :: View next topic  
Author Message
Constantine Hvan
Guest





PostPosted: Wed Jul 30, 2003 11:53 am    Post subject: sound in TEdit Reply with quote



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





PostPosted: Wed Jul 30, 2003 12:07 pm    Post subject: Re: sound in TEdit Reply with quote




"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





PostPosted: Wed Jul 30, 2003 12:14 pm    Post subject: Re: sound in TEdit Reply with quote



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





PostPosted: Wed Jul 30, 2003 12:50 pm    Post subject: Re: sound in TEdit Reply with quote

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





PostPosted: Wed Jul 30, 2003 12:56 pm    Post subject: Re: sound in TEdit Reply with quote


"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





PostPosted: Wed Jul 30, 2003 12:58 pm    Post subject: Re: sound in TEdit Reply with quote

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 Wink.

Hans.




Back to top
Jonathan Arnold
Guest





PostPosted: Wed Jul 30, 2003 1:20 pm    Post subject: Re: sound in TEdit Reply with quote

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:
http://www.keen.com/categories/categorylist_expand.asp?sid=5156620
Comprehensive C++Builder link site:
http://www.buddydog.org/C++Builder/c++builder.html



Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Wed Jul 30, 2003 4:57 pm    Post subject: Re: sound in TEdit Reply with quote


"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





PostPosted: Wed Jul 30, 2003 4:58 pm    Post subject: Re: sound in TEdit Reply with quote


"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





PostPosted: Thu Jul 31, 2003 8:57 am    Post subject: Re: sound in TEdit Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Usage) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.