We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

using enter key to tab to numericupdown controls causes error sound

Thread ID:

Created:

Updated:

Platform:

Replies:

66730 Aug 1,2007 07:47 PM UTC Sep 18,2007 11:35 AM UTC WinForms 1
loading
Tags: FAQ
Ben
Asked On August 1, 2007 07:47 PM UTC

I have a form that has a bunch of numericupdown controls. I would like the user to be able to use the enter key to tab to each control. However whenever the user does this the computer beeps an error sound.

I have looked at other posts and the only thing I could find is references to a textbox instead of a numericupdown control. They suggests that I use the e.Handled = True in the keypress event to get rid of that. However this does not work. Do I have to do something different with a numericupdown control?

Here is a copy of the code that I am using.

Private Sub UpDown9am_KeyPress(ByVal sender As Object, ByVal e As KeyPressEventArgs) Handles UpDown9am.KeyPress
If e.KeyChar = ChrW(Keys.Return) Then
SendKeys.Send("{TAB}")
e.Handled = True
End If
End Sub

I am using vb.net in visual studio 2005 on an XP machine.

gruu
Replied On September 18, 2007 11:35 AM UTC

Hi Ben,

It's working fine when I use SendKeys.SendWait() methos instead of SendKeys.Send() method. Here is the code snippet,

Private Sub NumericUpDown1_KeyPress(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles NumericUpDown1.KeyPress
If e.KeyChar = ChrW(Keys.Return) Then
SendKeys.SendWait("{TAB}")
e.Handled = True
End If
End Sub

Please let me know if its working for you.

Good Luck

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;