473,786 Members | 2,407 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 9954
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**@discussio ns.microsoft.co mwrote in message
news:34******** *************** ***********@mic rosoft.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**@discussio ns.microsoft.co mschreef in bericht
news:34******** *************** ***********@mic rosoft.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=fals e). 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=tru e), 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*****@discus sions.microsoft .comwrote in message
news:C0******** *************** ***********@mic rosoft.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=fals e). 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=tru e), 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
8760
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 Boolean Dim dwFreq As Long Dim dwDuration As Long
8
9128
by: Marcia Gulesian | last post by:
How can I create a beep in javascript (I.E. 5.5 +) ?
3
5472
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 check?
3
2901
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 associated with the System "Default Beep"?
5
15190
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
6893
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() For i = 0 to 100: Beep(): Next
4
1792
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
14173
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 sound is working, but this isn't. Is there something I am missing? Any help is appreciated
5
29280
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 tell my some hint abouit it? -- Rafael
0
9647
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9492
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10163
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10108
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8988
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7510
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5397
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3668
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2894
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.