How to Refer to a Form from a Menu or a Program (128074)



The information in this article applies to:

  • Microsoft Visual FoxPro for Windows 3.0

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.

Modification Type:MajorLast Reviewed:2/12/2000
Keywords:KB128074