I have a question about the focus of a dialog box.
If I have opened a dialog box, I need to execute a procedure if the dialog box gets the focus. I want to link some functions to function buttons F1 - F12. If the dialog box loses the focus, the link to the funcion buttons has to be undone.
To do so, I use this code :
- Code: Select all Expand view
DEFINE DIALOG oDlg NAME ....
......
oDlg:bGotFocus := { || KEY_ON() }
oDlg:bLostFocus := { || KEY_OFF() }
......
ACTIVATE DIALOG oDlg ....
What is the problem : if the dialog box loses the focus, I have noticed that the link to the function buttons is undone. But if the dialog box gets the focus again (by clicking on the dialog box), the link to the functions buttons is not accomplished.
What do I have to do to repair the link to the function buttons if the dialog box regains the focus ?
Thanks a lot in advance for any help.