hitting the "enter" key

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
 
T

The EEEdiot

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top