Trying to get the enter key to not make noise
-
Hello, The code works but the when you use the Enter key the program Beeps at me and I would like to stop that but still move to the next control.
Private Sub controls_KeyDown(ByVal Sender as object, BayVal e as Systes.Windows.Forms.KeyEventArgs) Handles combobox.KeyDown, textbox.KeyDown If e.keyCode = Keys.Enter Then Me.SelectNextControl(Ctpe(Sender, Control), True, True, True, False) End If End Sub
I have also tried many variations of code that is in the if block like SendKeys.Send("{TAB}") still makes the Beep Thank you Dale Burmeister -
Hello, The code works but the when you use the Enter key the program Beeps at me and I would like to stop that but still move to the next control.
Private Sub controls_KeyDown(ByVal Sender as object, BayVal e as Systes.Windows.Forms.KeyEventArgs) Handles combobox.KeyDown, textbox.KeyDown If e.keyCode = Keys.Enter Then Me.SelectNextControl(Ctpe(Sender, Control), True, True, True, False) End If End Sub
I have also tried many variations of code that is in the if block like SendKeys.Send("{TAB}") still makes the Beep Thank you Dale BurmeisterThe Enter and Tab keys are making noise because they are not valid keypresses at the time. Do you have all of your controls TabStop properties set to False? There is a condition setup somewhere that is making the default keyboard handlers (not your handlers!) in the form think that the keypress is not valid and, therefore, generates a beep to signal such an error. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
-
The Enter and Tab keys are making noise because they are not valid keypresses at the time. Do you have all of your controls TabStop properties set to False? There is a condition setup somewhere that is making the default keyboard handlers (not your handlers!) in the form think that the keypress is not valid and, therefore, generates a beep to signal such an error. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
The Tab key work just fine and does not Beep the Enter key Beeps only when it exits the if statement. All the TabStop properties on the ComboBoxes and TextBoxes set to True. The GroupBoxes the house the Combo and TextBoxes to do not have a TabStop properties (I think they are false all the time). The only other event that I have code in is SelectionChangeCommitted for the ComboBoxes and that I use to change a bunch of other things when it happens. I don't think I have any setup condition that touches the default keyboard handlers. Also the wired thing is that the Tab key does not fire the keyDown Event. Thank you for you help Dale Burmeister
-
Hello, The code works but the when you use the Enter key the program Beeps at me and I would like to stop that but still move to the next control.
Private Sub controls_KeyDown(ByVal Sender as object, BayVal e as Systes.Windows.Forms.KeyEventArgs) Handles combobox.KeyDown, textbox.KeyDown If e.keyCode = Keys.Enter Then Me.SelectNextControl(Ctpe(Sender, Control), True, True, True, False) End If End Sub
I have also tried many variations of code that is in the if block like SendKeys.Send("{TAB}") still makes the Beep Thank you Dale BurmeisterTry using the following code instead, it should work! (I haven't checked if it works or not.)
Private Sub controls_KeyDown(ByVal Sender as object, _ BayVal e as Systes.Windows.Forms.KeyEventArgs) Handles combobox.KeyDown, textbox.KeyDown If e.keyCode = Keys.Enter Then e.Handled = True Me.SelectNextControl(Ctpe(Sender, Control), True, True, True, False) End If End Sub
-
Try using the following code instead, it should work! (I haven't checked if it works or not.)
Private Sub controls_KeyDown(ByVal Sender as object, _ BayVal e as Systes.Windows.Forms.KeyEventArgs) Handles combobox.KeyDown, textbox.KeyDown If e.keyCode = Keys.Enter Then e.Handled = True Me.SelectNextControl(Ctpe(Sender, Control), True, True, True, False) End If End Sub