hitting the "enter" key

  • Thread starter Thread starter PJ6
  • Start date Start date
P

PJ6

I want to be able to, depending on the state of the page, direct what the
ENTER key causes the page to do.

The problem I'm having is I have a user control with a textbox and an
"enter" button. If this control is in a certain state, when the user hits
the ENTER key on that page, I want the ENTER event to be sent to the ENTER
button in that control, like the defuault button-clicking behavior I'm
seeing when a button is in the form istelf and not within a user control.

Is that possible?

Paul
 
You can also use something like:

Private Sub Page_PreRender(...) Handles MyBase.PreRender
DoSearch()
End Sub

Private btnSearch_Click(...) Handles btnSearch.Click
Do Search()
End Sub

Private Sub DoSearch()
....
End Sub

When they hit the Enter key it will act as if they hit the button.
 
Back
Top