PxPlus User Forum

Main Board => Discussions => Nomads => Topic started by: Jeff Wilder on October 27, 2021, 06:02:45 PM

Title: Finding the previous CTL ID on Default Push Button event
Post by: Jeff Wilder 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
Title: Re: Finding the previous CTL ID on Default Push Button event
Post by: Loren Doornek 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.
Title: Re: Finding the previous CTL ID on Default Push Button event
Post by: Mike King 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.