| Forum List • Thread List • Refresh • New Topic • Search • Previous • Next 1 | 1. Enter key #13131 | How can I simulate the pressing of my default push button when the enter key is pressed after entering data in an entry field? I found some documention that indicated the entry key would cause an 'unfocus' event to occur but that didn't work for me. George | 2. #13132 | The Reginald FAQ answers this question:
The way the ENTER key works in a single-line entry control is not all that intuitive. But this is the way that Microsoft designed it. In order to recognize the ENTER key, you have to put a PUSH control in the window, and give it the "Default button" style. (ie, Click that checkbox in the Properties dialog for your PUSH button).
Then, when the user presses the ENTER key in the entry, you'll receive a CLICK event for the button. That's not the way I would have designed it, but that's the way some MS employee did.
If you don't actually want the PUSH button to show, you could also give it the "Hide" style.
An alternate is to handle the UNFOCUS event for your ENTRY. That happens whenever the user tabs to another control, clicks on another control, or presses the ENTER key. In this case, you won't need a default button. | 3. Enter key #13133 | I tested a simply window with 1 entry field and a push button...this worked just as you said. The window that I can't get to work has multiple entry field (21). I do have a push button and it is defined as the default. When I press the enter key the cursor remains in the field and a beep occurs...the click event for the button is not generated. George | 4. #13134 | Multiple entry uses the enter key for a new line. (It doesn't matter if you've left no room to actually display multiple lines. But then, why are you using a multiple entry?) There's no way to cause the enter key to trigger a default push button in a multiple entry. | 5. Enter key #13135 | I have 21 single line entry fields...each field has a unique ID. My last posting was confusing. George | 6. #13139 | The procedure outlined in posting #2 works for entry fields with either a left or right alignment. It does not work if you use center alignment. George | Forum List • Thread List • Refresh • New Topic • Search • Previous • Next 1 |
|
|