Detect the carriage return in a cell

Posted by: banierp on 8 September 2017, 3:13 pm EST

  • Posted 8 September 2017, 3:13 pm EST

    Hello,

    I would like to detect the carriage return when a user has entered a value in a cell and hit Enter.
    Currently, I need to hit Enter 2 times to detect it in the KeyPress event.

    Could someone help me to ?

    Thanks

    Phil
  • Marked as Answer

    Replied 8 September 2017, 3:13 pm EST

    Hi Phil,

    In order to detect when the user has pressed the Enter key, I would suggest you to use the ActionMap and InputMap classes. Please refer to the attached sample application in which a MessageBox is displayed when the Enter key is pressed.

    Hope it helps. Feel free to revert in case you have any additional questions further.

    Thanks and Regards,
    Pragati Kaushik
    2014/04/CarriageReturn.zip
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels