I have a windows form with a tool strip on it containing a text box and some buttons (think browser url bar with a go button, back, forward)
I want pressing enter to activate the goButton just as clicking it would, which I believe is what TextBox.AcceptsReturn = false is for.
I don’t see anything that seems to fit the bill for “tell me what button on the form is the one that we will activate”.
What am I missing?
A
Formhas a default button, but a specific control does not (out of the box anyway).In your scenario, I would probably handle invoking the
goButton.Clickevent by monitoring the keys pressed waiting for the Enter key to be pressed.