I have defined a procedure under the click event of the button as follows.
Private Sub btnSearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSearch.Click
'Validate Department
If cmbDepartment.SelectedItem = Nothing Then
MsgBox("Please select a department", MsgBoxStyle.Information, "Notification")
cmbDepartment.Focus()
Exit Sub
End If
End Sub
I want to call this procedure when press on the enter key
Private Sub txtSearchValue_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtSearchValue.KeyPress
If Asc(e.KeyChar) = 13 Then
MsgBox("Run the btnSearch click event")
End If
End sub
Can anyone suggest me a way to do this???????
Would be a great help