Hi All,
Can you Open a child dialog again without close the parent dialog?
Can you Open a child dialog again without close the parent dialog?
Code:
dim childdlg as c dim childevent as c show_embedded(local_variables()) '{WATCH=a_dlg_button!showchild } ui_modeless_dlg_box("ParentDialog",<<%dlg% {startup=init} How do you open a child dialog again after forced to close the child dlg?;;; {frame=1,1} {embedded=40,20:ChildDialog}; {lf}; <Close>{sp}<Hello> <close child><show child!showchild>; %dlg%,<<%code% if a_dlg_button = "Hello" then 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 child" then ui_dlg_event("ChildDialog","close child",.t.) If ui_modeless_dlg_exist("childDialog")= .t. then ui_modeless_dlg_close("childDialog") end if end if If a_dlg_button ="showchild" then show_embedded(local_variables()) ui_dlg_create("ChildDialog",childdlg,childevent) ui_dlg_show("ChildDialog") 'ui_modeless_dlg_refresh("Childdialog") ui_modeless_dlg_setfocus("childDialog") ui_modeless_dlg_refresh("parentdialog") end if if a_dlg_button = "close" then ui_modeless_dlg_close("ParentDialog") end if %code%) function show_embedded as v (vars as P) with vars 'ui_modeless_dlg_box("ChildDialog", childdlg=<<%dlg% {wrap=40} This is an embedded dialog box that responds to the Hello event sent to it from its parent.; {lf}; Name: [.20name]; {lf}; Enter a name into the Name field and click this button. After 2 seconds, the "Hello" dialog box will appear.; {lf}; <Hello><close child>; %dlg% childevent=<<%code% if a_dlg_button = "Hello" then sleep(2) ui_msg_box("","Hello: " + name) end if If a_dlg_button ="close child" then If ui_modeless_dlg_exist("childDialog")= .t. then ui_modeless_dlg_close("childDialog") end if end if %code% end with end function
Comment