General XMetaL Discussion

XMetaL Community Forum General XMetaL Discussion XFT: Capture ENTER-Key in text box

  • spyro

    XFT: Capture ENTER-Key in text box

    Participants 3
    Replies 4
    Last Activity 11 years, 4 months ago

    Hi there,

    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?

    Thank you,
    spyro

    Reply

    Derek Read

    Reply to: XFT: Capture ENTER-Key in text box

    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?

    Reply

    spyro

    Reply to: XFT: Capture ENTER-Key in text box

    Hello Derek,

    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.

    spyro

    Reply

    Derek Read

    Reply to: XFT: Capture ENTER-Key in text box

    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”.

    Reply

    spyro

    Reply to: XFT: Capture ENTER-Key in text box

    Hi Derek,

    that sounds like a good idea. I will definitly give it a try today. Thank you (once more!)

    spyro

    EDIT: It worked! 🙂

    Reply

  • You must be logged in to reply to this topic.

Lost Your Password?

Products
Downloads
Support