Help and advice needed.
I've created a private sub which enables me to move to the next object when I press enter in the textbox or any input controls...
What I want to do is to create a universal sub procedure for moving to next object.
this is my code
Code 1 - but this will work only for textboxes
any suggestions or revisions? this sub procedure will work for textbox only... help needed... thanks...
Code 2 - but receiving errors such as "Option Strict On is disallowing Late binding"
I've created a private sub which enables me to move to the next object when I press enter in the textbox or any input controls...
What I want to do is to create a universal sub procedure for moving to next object.
this is my code
Code 1 - but this will work only for textboxes
VB.NET:
Private Sub MoveToNextObj(ByVal e As System.Windows.Forms.KeyEventArgs, ByVal NextOBj As Object)
Dim textOBj As TextBox
textOBj = CType(NextOBj, TextBox)
If e.KeyCode = Keys.Enter Then
textOBj.Focus()
End If
End Sub
any suggestions or revisions? this sub procedure will work for textbox only... help needed... thanks...
Code 2 - but receiving errors such as "Option Strict On is disallowing Late binding"
VB.NET:
Private Sub MoveToNextObj(ByVal e As System.Windows.Forms.KeyEventArgs, ByVal NextOBj As Object)
If e.KeyCode = Keys.Enter Then
NextOBj.Focus()
End If
End Sub
Last edited: