General XMetaL Discussion
spyro July 25, 2011 at 9:30 am
XFT: Capture ENTER-Key in text boxJuly 25, 2011 at 9:30 amParticipants 3Replies 4Last Activity 11 years ago
is seems that there's no OnKeyDown– or OnKeyPress-Event for the text box control in a XFT-Form so one can run code after the user presses the enter key.
I tried to use the ActiveX 'Microsoft Forms 2.0 TextBox' instead (which has a event for that) but for some strange reason I am not able to change the text at runtime (the control is enabled and not locked).
So, is there any way to capture the enter key within a xmetal form and native controls?
spyroDerek Read July 25, 2011 at 5:37 pm
Reply to: XFT: Capture ENTER-Key in text boxJuly 25, 2011 at 5:37 pm
Simple answer is no. Depending on what you need to do you could probably use OnChange to mimic OnKeyPress. What do you need to do?spyro July 26, 2011 at 8:21 am
Reply to: XFT: Capture ENTER-Key in text boxJuly 26, 2011 at 8:21 am
is there anything you don't know about XMetaL? 😉
I made a sort of “quick navigation” where you enter a XPATH statement and then navigate trough the hits in the documents (this was also the reason for my question about non-modal dialogs).
It works so far but the user can't simply press enter instead of clicking a button each time.
spyroDerek Read July 26, 2011 at 7:08 pm
Reply to: XFT: Capture ENTER-Key in text boxJuly 26, 2011 at 7:08 pm
You can set one button on your form to “fire” when the user presses Enter. You do this by setting the property for “default” to “yes”.
Then the button should do whatever it is set to do (which you set with ButtonType property).
If you have more than one button with default set to “yes” then only one will “fire”. However, you can also dynamically set this value, so perhaps if the user enters a particular EditBox you could set the corresponding button to have its default property set to “yes” and any others set to “no”.
- You must be logged in to reply to this topic.