PRB: Closing SDI Form with Menu Causes Objects to Shift UpwardLast reviewed: March 24, 1997Article ID: Q156243 |
The information in this article applies to:
SYMPTOMSIf a Single-Document Interface (SDI) or Top-Level form (form with the ShowWindow property set to 2 - As Top-Level Form) has a menu, releasing the form causes the controls contained within the form to momentarily shift upward before the form disappears.
WORKAROUNDSet the form's Visible property to .F. - False before releasing the form. See the MORE INFORMATION section below for details on implementing this.
STATUSThis behavior is by design.
MORE INFORMATIONVisual FoxPro 5.0 gives you the ability to create forms that can appear outside of (or in lieu of) the FoxPro desktop, and appear in the task list or on the task bar. These forms are called Top-Level, or SDI, forms, and require setting the form's ShowWindow property to "2 - As Top-Level Form." You can add menus, toolbars, and child forms to these forms in the same way you add them to the Visual FoxPro desktop in this and previous versions of Visual FoxPro.
Steps to Reproduce Behavior
To handle when the form is closed by clicking a command button, place the following in the Click method code for your Quit or Close command button:
* Close button Click() code THISFORM.Visible = .F. THISFORM.Release()To handle when the form is closed by clicking the Close [X] button under Windows 95 or NT 4.0, or pressing Alt+F4 or clicking Close on the Control menu, place the following in the QueryUnload() method code for the form:
* Form.QueryUnload() code THIS.Visible = .F.To handle when the form is released by clicking Exit (or equivalent) from the menu on the SDI form, add this to a procedure for the Exit bar of your menu:
* Menu Exit bar code LOCAL oForm oForm = _screen.ActiveForm _screen.ActiveForm.Visible = .F. oForm.Release() SET SYSMENU TO DEFAULT && Resets VFP menu back to default |
Keywords : FxprgClassoop FxtoolFormdes FxtoolMBuilder kbui vfoxwin kbprb
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |