I have at times had difficulties getting some events in xdialog to execute as expected. The code below is an example of a dialog with navigation buttons. I discovered that without some code being called before the code for cursor navigation, the cursor navigation does not execute. After many attempts, I ended up with dlg_blink() as a solution. I thought folks might be interested in case they have run into the same problems. There is probably another/different solution, but I couldn't discover it.
Code:
dim vLcsid as C="" for i = 1 to 200 vLcsid=vLcsid+padl((""+i),6,"0")+crlf() next 'SELECT THE STORE NUMBER dim vRsn as C dim vcsidK as C vRsn=ui_dlg_box("STORE ID SELECTION",<<%dlg% {font=arial,12,b}{background=hsi lblue} {region}{lf=.5};{sp=17}Customer Store Numbers;{font=arial,8,b} {comment=navigation buttons} {lf=.5};{sp=21}<%O={J=C}{I:'$$navigate.move.prev'};OF={J=C}{I:'$$navigate.move.prev'}%12,1!left> {sp=3}<%O={J=C}{I:'$$navigate.move.next'};OF={J=C}{I:'$$navigate.move.next'}%12,1!right> {endregion}; {comment=list box} {region} {initial_focus}[%c=13,43%.66,31vcsidk^#vLcsid]; {sp=5}Customer Store Number: [.16vcsidk]; {line=1,0}{endregion};{lf=.5}; {justify=center}<15Save> <15Cancel> %dlg%,<<%code% if a_dlg_button="right" dlg_blink() sys_send_keys("{RIGHT}") a_dlg_button="" end if if a_dlg_button="left" dlg_blink() sys_send_keys("{LEFT}") a_dlg_button="" end if %code%) 'SUBFUNCTION $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ FUNCTION dlg_blink as C ( ) 'blink dlg to get code to slow and show ui_dlg_box("blink",<<%dlg% {nocaption}{position=20,20}{timer=rotate} {interval=.1}{lf}; %dlg%,<<%code% if a_dlg_button="rotate" then ui_modeless_dlg_close("blink") end if %code%) END FUNCTION