Microsoft KB Archive/138601

= How to Make a Form Disappear =

Article ID: 138601

Article Last Modified on 2/11/2000

-

APPLIES TO


 * Microsoft Visual FoxPro 3.0 Standard Edition

-



This article was previously published under Q138601



SUMMARY
At times, it may be necessary to run a form without displaying it. If the Visible property of a form is set to False (.F.) at design time, the DO FORM command will still display the form.



MORE INFORMATION
When the DO command is issued, an implicit This.Show is run and the form is displayed. To run the form invisibly, add the following code to the Show method of the form: IF THIS.VISIBLE = .f.  NODEFAULT ENDIF This code tells Visual FoxPro that the form should not do its normal Show routine and to execute the code following the NODEFAULT clause.

NOTE: To make the form visible prior to releasing the form from memory, use the NAME clause of the DO FORM command. For example, DO FORM test NAME myform could be used and issuing myform.visible = .t. in the Command window would make the form visible again.

Step-by-Step Example
  In the Command window, type: CREATE FORM TEST  Select the Property sheet, and change the Visible property to false (.F.). Close and save the form.  In the Command window, type: DO FORM test   To make the form disappear, add the following code to the Show method of the form: IF THIS.VISIBLE = .f.     NODEFAULT ENDIF 

Additional query words: VFoxWin

Keywords: KB138601

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.