Board index » delphi » Getting rid of the sound when pressing ENTER

Getting rid of the sound when pressing ENTER

Hello,

I want to know if there is a way to get rid of the beep sound when someone
press ENTER in a TEdit/TDBEdit; other than going into the Control
Panel/Sound and deleting the default sound.

HDumas

 

Re:Getting rid of the sound when pressing ENTER


Hi HD,

Quote
> I want to know if there is a way to get rid of the beep sound when someone
> press ENTER in a TEdit/TDBEdit; other than going into the Control
> Panel/Sound and deleting the default sound.

In the OnKeyPress, see if the Key is #13 and turn it into #0.

See the "epilogue" of http://www.drbob42.com/tip/tiphat02.htm for an
actual code example...

Quote
> HDumas

Groetjes,
          Bob Swart (aka Dr.Bob - www.DrBob42.com)

--
Bob Swart Training & Consultancy (eBob42)  Borland Technology Partner
webmaster UK Borland User Group (BUG) & DotNet Developers Group (DDG)

Re:Getting rid of the sound when pressing ENTER


Quote
"HD" <d...@hotmail.com> wrote in message

news:3ea539bd$1@newsgroups.borland.com...

Quote
> Hello,

> I want to know if there is a way to get rid of the beep sound when someone
> press ENTER in a TEdit/TDBEdit; other than going into the Control
> Panel/Sound and deleting the default sound.

This is hardly "non-technical", but set Key := 0 when Key = 13 in the edits'
OnKeyDown handler.

Ian

Re:Getting rid of the sound when pressing ENTER


Thank you very much Bob.

"Bob Swart" <b.sw...@chello.nl> a crit dans le message de news:
3EA53A76.BA062...@chello.nl...

Quote
> Hi HD,

> > I want to know if there is a way to get rid of the beep sound when
someone
> > press ENTER in a TEdit/TDBEdit; other than going into the Control
> > Panel/Sound and deleting the default sound.

> In the OnKeyPress, see if the Key is #13 and turn it into #0.

> See the "epilogue" of http://www.drbob42.com/tip/tiphat02.htm for an
> actual code example...

> > HDumas

> Groetjes,
>           Bob Swart (aka Dr.Bob - www.DrBob42.com)

> --
> Bob Swart Training & Consultancy (eBob42)  Borland Technology Partner
> webmaster UK Borland User Group (BUG) & DotNet Developers Group (DDG)

Other Threads