Hi
This is an a5 Embedded xdlg sample. I have the trouble understanding the "sharing" value between child and parent xdialog coding.
After I entered the value at child, I just want to see the value at Parent xdialog.
How do shared the data from Child to parent xdialog?
This is an a5 Embedded xdlg sample. I have the trouble understanding the "sharing" value between child and parent xdialog coding.
After I entered the value at child, I just want to see the value at Parent xdialog.
How do shared the data from Child to parent xdialog?
Code:
dim name as c ui_modeless_dlg_box("ParentDialog",<<%dlg% {startup=init} {frame=1,1} [COLOR="#FF0000"]Name from child: [.20name];[/COLOR] {lf}; <Close>{sp}<Hello>; %dlg%,<<%code% if a_dlg_button = "Hello" then show_embedded(local_variables()) ' ui_dlg_event("ChildDialog","Hello",.t.) ' ui_msg_box("","Another message from the parent dialog") end if if a_dlg_button = "init" then a_dlg_button = "" show_embedded(local_variables()) end if if a_dlg_button = "close" then ui_modeless_dlg_close("ParentDialog") end if %code%) function show_embedded as C (vars as P) with vars ui_modeless_dlg_box("ChildDialog",<<%dlg% {wrap=40} This is an embedded dialog box that responds to the Hello event sent to it from its parent.; {lf}; [COLOR="#FF0000"]Name: [.20name];[/COLOR] {lf}; Enter a name into the Name field and click this button. After 2 seconds, the "Hello" dialog box will appear.; {lf}; <Hello><close>; %dlg%,<<%code% if a_dlg_button ="close" then ui_modeless_dlg_close("ChildDialog") end if if a_dlg_button = "Hello" then sleep(2) ui_msg_box("Child","Hello: " + name) end if %code%) end with end function
Comment