BUG: Opening Then Closing 2nd Modal Form Disables VFP Close Box (232130)



The information in this article applies to:

  • Microsoft Visual FoxPro for Windows 5.0
  • Microsoft Visual FoxPro for Windows 5.0a
  • Microsoft Visual FoxPro for Windows 6.0

This article was previously published under Q232130

SYMPTOMS

You have a Visual FoxPro application which runs a modal form. This modal form displays a second modal form. After closing the second modal form and returning to the first modal form, the close box in the Visual FoxPro desktop becomes disabled.

RESOLUTION

As a workaround, in the Destroy method of the second modal form, set the form's Visible property to .F. and toggle the _SCREEN.Closable property to .F. and back to .T.. This code demonstrates:
Thisform.Visible = .F.
_SCREEN.Closable = .F.
_SCREEN.Closable = .T.
				
There may be a very rapid flicker of the close box, but the flicker should only be visible if you look directly at the close box when you close the form.

STATUS

Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

MORE INFORMATION

Steps to Reproduce Behavior

  1. Run the following code from a program (.PRG) file:
    LOCAL loForm1
    loForm1 = CREATEOBJECT('form1')
    loForm1.SHOW
    
    Define CLASS form1 AS FORM
       Caption = 'Form 1 - Click on me to open next form'
       WindowType = 1
       Procedure CLICK
          LOCAL loForm2
          loForm2 = CREATEOBJECT('form2')
          loForm2.SHOW
       Endproc
    Enddefine
    
    Define CLASS form2 AS FORM
       Caption = 'Form 2 - Click on [X] to close me'
       AutoCenter = .T.
       WindowType = 1
       Procedure DESTROY
          * Uncomment following 3 lines of code for workaround
          * This.Visible = .F.
          * _Screen.Closable = .F.
          * _Screen.Closable = .T.
       Endproc
    Enddefine
    					
  2. Click on Form 1 in an area other than the titlebar. Form 2 displays.
  3. Click on the close box in Form 2. This is the [X] in the upper right corner of the form.
  4. The close box in the Visual FoxPro desktop is disabled. It appears grayed out and will not respond to mouse clicks.
  5. Uncomment the code in the Destroy procedure for Form 2 to demonstrate the workaround.

REFERENCES

(c) Microsoft Corporation 1999, All Rights Reserved. Contributions by Jim Saunders, Microsoft Corporation.


Modification Type:MajorLast Reviewed:10/16/2002
Keywords:kbBug kbContainer kbCtrl KB232130