FIX: WindowType Changed at Run Time Can't Be Changed Back (141558)



The information in this article applies to:

  • Microsoft Visual FoxPro for Windows 3.0
  • Microsoft Visual FoxPro for Windows 3.0b

This article was previously published under Q141558

SYMPTOMS

You attempt to change the WindowType of a running form from modeless to modal and then back to modeless. On the switch from modeless to modal, you succeed. But the attempt to switch the now modal form to modeless fails.

WORKAROUND

Although there isn't much call to do this at run time, the switch is one way only. There is no way to programmatically change it back.

STATUS

Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. This problem has been fixed in Visual FoxPro 5.0.

MORE INFORMATION

The WindowType of a form should be a property you set a design time; not run time.

Steps to Reproduce Problem

  1. Create a new form, and set the form's WindowType property to Modeless.
  2. Place a command button on the form. In the Click method, add the following line of code:
          THISFORM.SHOW(1)
    						
  3. Change the Caption property to Modal. Place a second command button on the form, and add the following code to its Click event:
          THISFORM.SHOW(2)
    						
  4. Change the Caption property to Modeless. Place a third command button on the form. Change its Caption property to Release, and add the following code to its Click event:
          THISFORM.RELEASE
    						
  5. Run the form. If you click the Release command button, the form closes as expected. If you click the Modal command button, the form becomes modal. You may test this by trying to click outside of the form and noting you are unable to activate anything outside of the form or access any other part of the Windows interface. If you then click the Modeless command button, the form does not return to a modeless WindowType. The form remains modal. The Release command button does not release the form. You must cancel the program to exit.

Modification Type:MajorLast Reviewed:9/30/2003
Keywords:kbbug kbfix KB141558