473,399 Members | 3,919 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,399 software developers and data experts.

Prevent Beep on Enter (Again)

I know this was recently posted in reference to a textbox, but I'm
having a similar problem, and can't keep it from beeping. I'm using a
NumericUpDown control instead of a textbox. I've tried this code in the
KeyPress and the KeyDown events. None of the below code prevents the beep.

If e.KeyCode = Keys.Enter Then
e.Handled = True
...
End If

If e.KeyChar = vbCr Then
e.Handled = True
...
End If

If e.KeyChar = Chr(13) Then ' Same as above
e.Handled = True
...
End If

J.
--
The email address listed is not my real address. Please do not send
valid email to that address.
Nov 20 '05 #1
1 1799
"Jay Banks" <sp*********@chooseyourmail.com> schrieb
I know this was recently posted in reference to a textbox, but I'm
having a similar problem, and can't keep it from beeping. I'm using
a
NumericUpDown control instead of a textbox. I've tried this code in
the KeyPress and the KeyDown events. None of the below code
prevents the beep.


Derive your own Control from NumericUpdown and add this code:

Protected Overrides Sub OnTextBoxKeyPress( _
ByVal source As Object, _
ByVal e As System.Windows.Forms.KeyPressEventArgs)

If e.KeyChar = Chr(13) Then
e.Handled = True
Else
MyBase.OnKeyPress(e)
End If
End Sub

--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #2

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

Similar topics

6
by: Leo | last post by:
hi there i want python to do a beep. in the docu i found in tkinter the method bell() but the script: import Tkinter Tkinter.bell() gives the error:
4
by: fransjan | last post by:
Hi all. I have a small problem: I have a table with standard data (about 25 records). When a button is pressed on a form a query is being run that adds the records from this table to an other...
8
by: strchild | last post by:
Hi again guys, I apologize as it's been posted before and I'm sure it's an easy problem to fix, but the message has long since left my news server now that I need it, and I can't find it...
2
by: K E Senthil Kumar | last post by:
I use this code to find a record. I want to beep a sound when no record is found. But even when the record is found, the beep is sounding. What is wrong with the code here Private Sub...
14
by: Ed Jay | last post by:
On a multi-textbox form, linked to an external js, I use onBlur to call: function chkNum(cellname) { var str = document.getElementById(cellname).value.toString(10); if (str < 28 || str > 36)...
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: NEWSGROUPS | last post by:
I have some users that continuously end task on my database when a search takes to long. In turn corrupting the application. Is there any way to prevent this? The Microsoft KB for Methods That Can...
4
by: =?Utf-8?B?UmljaA==?= | last post by:
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? ...
7
vdraceil
by: vdraceil | last post by:
I'm currently working on a project in vb6. I have a textbox in which the user is supposed to enter his/her name and press enter. When i give my name and press enter a short beep is heard, but the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...
0
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...

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.