I'm looking for a way to avoid that nasty *beep* you get every time you press the ENTER key in a textbox / combobox. I found this code in the VB section but don't know how to translate it:
In this example its a TAB but in my case it's an ENTER. I can't translate it cuz the e.KeyChar value returned by KeyPress on C# cannot be modified like you can in VB.Code:Private Sub Text1_KeyPress(KeyAscii As Integer) If KeyAscii = vbKeyTab Then KeyAscii = 0 ' "Eat" the tab to avoid the beep RestoreTabStops Text1 End If End Sub
Can anyone tell me how to accomplish this? Thanks!




Reply With Quote