How to Refer to a Form from a Menu or a Program

Last reviewed: April 30, 1996
Article ID: Q128074
The information in this article applies to:
  • Microsoft Visual FoxPro for Windows, version 3.0

SUMMARY

The Windows Interface Guidelines specify that an option available from a toolbar should also be available on a menu. The toolbar or the menu might be associated with different forms, and it might be necessary to have a way to access a form's methods without explicitly naming it.

MORE INFORMATION

The ACTIVEFORM property specifies the active form in a form set or on the main FoxPro window. It can be used to refer to a form from a menu or a toolbar. However, to access a method of a form, you must identify and go down the container hierarchy. A generic way to access a form would therefore include the highest container, the main FoxPro window. The _SCREEN memory variable is a reference to the main FoxPro window, so the following shows a generic way to call a method of a form from a menu:

   _SCREEN.ActiveForm.callmethod()

Use the same method if the form is in a form set.


Additional reference words: 3.00 VFoxWin
KBCategory: kbprg
KBSubcategory: FxprgGeneral


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: April 30, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.