473,326 Members | 2,023 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

how to suppress beep (beep sound)

When I press the Enter key in a Textbox I get a beep sound. But when I press
the Enter key in a combobox, I don't get the beep sound. Is there a way to
suppress the beep? How to do this?

Thanks
Feb 14 '07 #1
4 9867
I've experienced the same thing when I did a quick "command style" textbox
that I wanted to fire off the command entered in the box when you press
enter.. and it all worked good with the exception that it fired off the Beep
sound. Since its basically telling you that you cant create a new line in a
single-line box.

So what I did was making the textbox multiline and use the keydown event to
figure out of I pressed enter and then cleared the textbox and sent the
command.. And since it was a multiline box it didnt complain about the new
line that pressing enter does.

Not sure if you can do the same somehow.. I know its a dirty trick but
worked for me :P I don't know if you're trying to handle something when you
press enter or just want to get rid of the beep.

"Rich" <Ri**@discussions.microsoft.comwrote in message
news:34**********************************@microsof t.com...
When I press the Enter key in a Textbox I get a beep sound. But when I
press
the Enter key in a combobox, I don't get the beep sound. Is there a way
to
suppress the beep? How to do this?

Thanks
Feb 14 '07 #2
Rich,

http://groups.google.nl/group/micros...dc7888442c55c3

I have seen Armin again active last week, so maybe he answers himself

Cor

"Rich" <Ri**@discussions.microsoft.comschreef in bericht
news:34**********************************@microsof t.com...
When I press the Enter key in a Textbox I get a beep sound. But when I
press
the Enter key in a combobox, I don't get the beep sound. Is there a way
to
suppress the beep? How to do this?

Thanks

Feb 15 '07 #3
When I press the Enter key in a Textbox I get a beep sound. But when I
press
the Enter key in a combobox, I don't get the beep sound. Is there a way to
suppress the beep? How to do this?
I believe there is a windows issue with beeps and the enter key. Try
running without the min/restore/close feature in the window (ie set the
form's ControlBox=false). This may (no promises) stop the beep when you hit
the enter key, but you will have a window without a control box in the upper
right corner. Put the control box back (ControlBox=true), and the beep will
return. In theory, there is a way to have ControlBox=true and have a
beep-less enter key. You intercept WM_MENUCHAR, and return MNC_CLOSE from
the window procedure. I have never tested this, so once again, no promises.
I think the beep is a windows response to a failed menu access key or
something like that.

What I do is live with the beeps because I want a ControlBox true and I want
to keep things simple.

Feb 17 '07 #4
There are NO windows issue with beeps and the enter key.

If you press the Enter key in a TextBox that is NOT MultiLine then you will
get a beep. This is by design because you can't enter a newline in such a
TextBox.

To suppress, the beep, simply handle the KeyPress event of the TextBox and
if it was the Enter key that was pressed the set e.handled to true before
allowing the event handler to terminate. If you wish some other action to
occur when the Enter key is pressed then put code for that in the same
place.
"AMercer" <AM*****@discussions.microsoft.comwrote in message
news:C0**********************************@microsof t.com...
>When I press the Enter key in a Textbox I get a beep sound. But when I
press
>the Enter key in a combobox, I don't get the beep sound. Is there a way
to
suppress the beep? How to do this?

I believe there is a windows issue with beeps and the enter key. Try
running without the min/restore/close feature in the window (ie set the
form's ControlBox=false). This may (no promises) stop the beep when you
hit
the enter key, but you will have a window without a control box in the
upper
right corner. Put the control box back (ControlBox=true), and the beep
will
return. In theory, there is a way to have ControlBox=true and have a
beep-less enter key. You intercept WM_MENUCHAR, and return MNC_CLOSE from
the window procedure. I have never tested this, so once again, no
promises.
I think the beep is a windows response to a failed menu access key or
something like that.

What I do is live with the beeps because I want a ControlBox true and I
want
to keep things simple.
Feb 18 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: bill_m | last post by:
Has anyone tried to use the .NET Beep function? The following works in VBA: Private Declare Function Beep Lib "Kernel32.dll" _ (ByVal X As Long, ByVal Y As Long) As Long Dim blVal As...
8
by: Marcia Gulesian | last post by:
How can I create a beep in javascript (I.E. 5.5 +) ?
3
by: MLH | last post by:
Sound works on my computer. I can play MIDI files, audio CD's. My standard wave files play OK (IE, C:\windows\Media\tada.wav). But running DoCmd Beep doesn't result in a sound. What can I...
3
by: Thom Little | last post by:
The following code will produce a sound in C# ... using System.Runtime.InteropServices; Beep( 500, 500 ); private static extern bool Beep( int freq, int dur ); How can I play the sound...
5
by: John Lee | last post by:
Hi, It's anoying each time the computer beeps when MessageBox.Show() popsup - I turned off all sound in control panel - audio setting but it still beeps. Can anyone help? Thanks! John
4
by: Rich | last post by:
Hello, I want to use the Beep() to alert users about certain messages but in my workstation I can't get a sound out of it. But Beep works in VB6. What do I need to do? Sub... .... Beep()...
4
by: Ross | last post by:
Anyone have any code that will sound a click from the PC speaker with keystrokes? Any easy way to get a beep out of the PC speaker (not through the sound card)? Thanks, Ross
4
by: Shyguy | last post by:
I have never used the DoCmd.Beep method and as far as I can tell all I need to do is enter "DoCmd.Beep". I put this behind a buttons on click and nothing. My sound is working. The computers beep...
5
by: =?Utf-8?B?UmFmYWVs?= | last post by:
I'm studying C# (I've been a VB developer). I'm making some tests and I need to use Console.Beep(), but it doesn't make any sound, no matter if I try it in VS2008 beta or VS2005. Could anybody...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.