BUG: Form Does Not Release After Being Changed to ModalLast reviewed: May 1, 1997Article ID: Q135612 |
The information in this article applies to:
SYMPTOMSWhen a form is changed from modeless to modal during run time, the form cannot be closed (terminated).
WORKAROUNDIf the form needs to be Modal, set the WindowType to Modal at design time.
STATUSMicrosoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.
MORE INFORMATIONWhen a form is changed to Modal at run time, it does not release when a Release ThisForm or ThisForm.Release is issued. The only way to close the form is to cancel the program.
Steps to Reproduce ProblemExample One:
Setting the modal property programatically before the program executes causes the form to behave a little differently. Run the following program with the form's WindowType property set to 1. Click the Release button and verify that although the form is no longer visible, it has not closed. However, defining the form as modeless and then changing it to modal by pressing the Modal command button causes the form to remain on the screen.
******* Start of Example ******* frmModalForm=CREATEOBJECT("ModalForm") frmModalForm.Show READ EVENTS DEFINE CLASS ModalForm AS Form Top = 9 Left = 26 DoCreate = .T. Caption = "Modal Form Test" WindowType = 1 && Change WindowType to 0 to start the form as Modeless ADD OBJECT Command1 AS CommandButton WITH ; Top = 145, ; Left = 31, ; Height = 29, ; Width = 94, ; Caption = "Modal", ; Name = "Command1" ADD OBJECT Command2 AS CommandButton WITH ; Top = 145, ; Left = 127, ; Height = 29, ; Width = 94, ; Caption = "Modeless", ; Name = "Command2" ADD OBJECT Command3 AS CommandButton WITH ; Top = 145, ; Left = 225, ; Height = 29, ; Width = 94, ; Caption = "Release", ; Name = "Command3" PROCEDURE Command1.Click ThisForm.Visible=.f. ThisForm.Show(1) ThisForm.Visible=.t. ENDPROC PROCEDURE Command2.Click ThisForm.Visible=.f. ThisForm.Show(0) ThisForm.Visible=.t. ENDPROC PROCEDURE Command3.Click ThisForm.Release CLEAR Events ENDPROC ENDDEFINE ******* End of Example ******* |
Additional query words: 5.00 3.00 3.00b
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |