Hello, I googled this but all solutions gave me errors, like:
Private Sub Textbox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles Me.KeyPress
If Char.IsControl(e.KeyChar) Then
If e.KeyChar.Equals(Chr(Keys.Return)) Then
Me.Parent.SelectNextControl(Me, True, True, False, True)
e.Handled = True
End If
End If
End Sub
The error :
SelectNextControl is not a member of System.Web.UI.Control
And the following one:
Private Sub TextBox_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs)
Dim tb As TextBox
tb = CType(sender, TextBox)
If Char.IsControl(e.KeyChar) Then
If e.KeyChar.Equals(Chr(Keys.Return)) Then
Me.SelectNextControl(tb, True, True, False, True)
e.Handled = True
End If
End If
End Sub
gives a similar one for the line:
Me.SelectNextControl(tb, True, True, False, True)
This one:
Private Sub Text1_KeyPress(ByVal KeyAscii As Integer)
If KeyAscii = 13 Then ' The ENTER key.
SendKeys."{tab}") ' Set the focus to the next control.
KeyAscii = 0 ' Ignore this key.
End If
End Sub
The error is :
SendKeys is a type and cannot be used as expression
I replaced it with:
SendKeys.Send("{tab}")
but with no effect :(
I used someone else, and told me that teextbox1.KeyPress is not found
I am using windows server 2008, visual basic 2008 version