PxPlus User Forum

Twitter Twitter Twitter

Author Topic: Finding the previous CTL ID on Default Push Button event  (Read 1000 times)

Jeff Wilder

  • Silver Member
  • ***
  • Posts: 42
    • View Profile
Finding the previous CTL ID on Default Push Button event
« on: October 27, 2021, 06:02:45 PM »
Hello,
I have a Nomads form with several multi_line controls and a button with the Default Push Button property set. When the user presses enter, my button click logic is executed.

My question: Is it possible to know inside that button click logic which multi_line had focus when the user pressed the enter key? All of the Nomads ID related variables appear to point to the button CTL, but I am looking for the multi_line CTL.

Thank you,
Jeff

Loren Doornek

  • Gold Member
  • ****
  • Posts: 85
    • View Profile
Re: Finding the previous CTL ID on Default Push Button event
« Reply #1 on: October 27, 2021, 07:11:23 PM »
Try DEC(MID(MSE,25,2)).  That should return ID of the last control to lose focus.

Mike King

  • Diamond Member
  • *****
  • Posts: 3811
  • Mike King
    • View Profile
    • BBSysco Consulting
Re: Finding the previous CTL ID on Default Push Button event
« Reply #2 on: October 28, 2021, 08:49:03 AM »
Generally, for buttons, you can set the signal only option to have the system process the event but not change focus.  This means the current focus is the control you were on when the button was pressed.

The only drawback is any on change or loss of focus logic for the control you were on when pressing the button will not fire as you technically aren't leaving that control.
Mike King
President - BBSysco Consulting
eMail: mike.king@bbsysco.com