Guidance
指路人
g.yi.org
Guidance Forums / Reginald Rexx / Enter key

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
Message1. Enter key
#13131
Posted by: gaburton 2009-10-04 09:22:43
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
Message2.
#13132
Posted by: Jeff Glatt 2009-10-04 11:32:39
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.
Message3. Enter key
#13133
Posted by: gaburton 2009-10-05 20:51:55
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
Message4.
#13134
Posted by: Jeff Glatt 2009-10-06 01:25:45
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.
Message5. Enter key
#13135
Posted by: gaburton 2009-10-06 01:32:24
I have 21 single line entry fields...each field has a unique ID.  My last posting was confusing.
George
Message6.
#13139
Posted by: gaburton 2009-10-16 23:32:20
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 • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
掌柜推荐
 
 
¥289.00 ·
 
 
¥1,080.00 ·
 
 
¥1,380.00 ·
 
 
¥638.00 ·
 
 
¥1,290.00 ·
 
 
¥1,420.00 ·
© Sun 2024-11-24  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0