Page 1 of 1

OnChange Event Question

Posted: Mon Oct 21, 2019 4:37 pm
by Red2
In the IDE when I select a form's TEXTBOX control, click its “Events” tab to add code to its OnChange event then an “OnChange” .PRG is added. However, this .PRG is specific to that control. If I attempt to add it to another TEXTBOX control I get error, “Module Already in Project. Aborted”.

The issue: I have a form with over 20 TEXTBOX controls. I want one single (generic) function called by the OnChange event in all of these TEXTBOX controls. That is, I want to avoid 20 duplicate “OnChange” .PRGs unnecessarily cluttering the project.

Question: Is there a simply way to generically handle all of these OnChange events using one single function?

I would appreciate your kind guidance on how this is best accomplished in HMG.

Thank you, Red2

Re: OnChange Event Question

Posted: Mon Oct 21, 2019 5:50 pm
by mol
You can assign this defined function to this event without creating new .prg. Don't use plus button, simply type your function name with parameters

Re: OnChange Event Question

Posted: Mon Oct 21, 2019 6:40 pm
by Red2
Hi mol,

Thank you very much. That was so obvious and simple but I missed it.

Thanks again!

Red2