Well, I lived with this problem for a long time and looked at it here.
After thinking about this for quite some time and wanting the easiest way to fix it, I came up with the easiest, but not very elegant way to fix it.
Here is what I did.
- Place the two invisible buttons "OK" and "Cancel" on the form.
- Set the AcceptButton and CancelButton properties on the form to invisible buttons.
- Added code for buttons!
This resolved all the secondary problems listed in this thread, including ToolStripMenu. My biggest complaint was the BindingNavigator when I entered the record number at the current position to go and press enter.
According to the original question, in which the programmer wanted the search function when pressing the enter button, I just put the search code in an invisible OK button!
So far this seems to solve all the problems, but as we all know with Visual Studio, something is likely to come up.
The only elegant way that I could think of is to write a new keystroke handling class that allows me to work a lot for most of my projects.
user2793447 Apr 20 '15 at 1:29 2015-04-20 01:29
source share