Thanks Steve. That works!
>Joe,
>
>This line, "oApp.oCaller = This", is creating a reference to the form in the application object. This probably prevents the form from releasing. In your form release() (or unload()?), you can put the following:
>
>
oApp.caller = NULL
>
>However, I see a greater design problem here...if you have two forms running at the same time, and the user right-clicks in each, things may start to fall apart.
>
>HTH.
>
>
>>
>>I have a form(s) which won't close after the RightClick event of the textbox(s) have occured (They close normally up to then). The QueryUnload event fires and set the form object to .NULL., but the form is still visible. The < object>.Release, _SCREEN.ActiveForm.Release, and RELEASE WINDOWS < form> methods and functions have no effect. The only way I've been able to close them is with CLEAR ALL.
>>
>>The textbox (acctTextBox) object calls a shortcut menu (txtRightClick.mpr) which executes code in an application object (oApp).
>>
>>Anyone know whats going on? I've included the existing code.
>>
>>Thanks,
>>Joe
>>
>>*/ - acctTextBox.RightClick
>>IF This.CalcField
>> oApp.oCaller = This
>> DO txtRightClick.mpr
>>ENDIF
>>
>>*/ -oApp.txtRightClick
>>PROCEDURE txtRightClick
>>LPARAMETERS lChoice
>> This.CalcMode = lChoice
>> IF !lChoice
>> This.oCaller.BackColor = RGB(255,0,0)
>> This.oCaller.ForeColor = RGB(255,255,255)
>> ELSE
>> This.oCaller.ForeColor = RGB(0,0,0)
>> This.oCaller.BackColor = RGB(255,255,255)
>> ENDIF
>> _screen.ActiveForm.Destroy
>> This.oCaller.Setfocus()
>>ENDPROC
>>
>>*/ -txtRightClick.mpr
>>DEFINE POPUP shortcut SHORTCUT RELATIVE FROM MROW(),MCOL()
>>DEFINE BAR 1 OF shortcut PROMPT "Manual"
>>DEFINE BAR 2 OF shortcut PROMPT "Calculate"
>>ON SELECTION BAR 1 OF shortcut oApp.txtRightClick(.F.)
>>ON SELECTION BAR 2 OF shortcut oApp.txtRightClick(.T.)
>>
>>ACTIVATE POPUP shortcut
>>