Knowledge Base

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

Article ID: 128074

Article Last Modified on 2/12/2000


APPLIES TO


This article was previously published under Q128074

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 query words: VFoxWin 3.00

Keywords: KB128074