Hello,


I was wondering How to build for opening and close with "pop-up menu" within an xdialog. I found the solution from Help (see {CLOSE_ON_LEAVE} ).
Many developers are already know it and It may help the others.

This is copy of the sample from {CLOSE_ON_LEAVE} with modification.

Code:
files = <<%str%
apples.txt
oranges.txt
%str%

ui_dlg_box("Position",<<%dlg%
[%P=files%.40file] | <&Files!files>;
| <\>\>>;
| <sticky>;
| <Open>;
| <Popup>;

%dlg%,<<%code%

	if a_dlg_button = "files" then
		    a_dlg_button = ""
		    ui_modeless_dlg_box("Files",<<%dlg%
			{position=dropdown}
			{nocaption}
			{close_on_leave}
			{on_key=enter}
			[.40,20file^#files!file_*]
		
			%dlg%,<<%code1%
		
			if a_dlg_button = "enter" .or. a_dlg_button = "file_dblclick" .or. a_dlg_button = "" then
			    a_dlg_button = ""
			    ui_modeless_dlg_close("Files")
			end if
		
			%code1%)
		
	else if a_dlg_button = ">>" then
	    a_dlg_button = ""
	    ui_dlg_box("Files",<<%dlg%
		{position=expandright}
		[.40,20file^#files] <Close>
		
		%dlg%)
	
	else if a_dlg_button = "sticky" then
	    a_dlg_button = ""
	    ui_dlg_box("Sticky",<<%dlg%
		{position=relative,remember=sticky_window}
		{size=remember=sticky_window}
		This is a sticky dialog | <Ok>;
		{stretch=center}
		[.30,10dummy]
		%dlg%)
		
[COLOR="#FF0000"]

	else if a_dlg_button = "open" then
	    'a_dlg_button = ""  'Disable so it will close the current xdialog
	    form.view("Your_form")

'Build Popup menu, How to close current xdialog when open a form the other remained the xdialog
	    
	else if a_dlg_button ="popup" then
		
		vMenu = comma_to_crlf("New Price,Update Price,Report") 'Set the Popup Menu
		result = ui_popup_menu(vmenu)
		
		if result = "New Price" then 
			'a_dlg_button = ""  [COLOR="#0000FF"]'Disable so it will close the current xdialog[/COLOR]
			vForm = "Your_form"
			if is_object(obj(":"+vForm)) then
			    vForm.show()
			    vForm.activate()
			else
				:form.view(vForm)    
			end if	
		else if Result = "Update Price" 
			a_dlg_button =""
			msgbox("test","open an xdlg form")
				
		else if result = "Report"
			a_dlg_button =""
			msgbox("test","Selected Report Filter now")	
		end if	[/COLOR]		    
	end if

%code%)