General information
Category:
Forms & Form designer
>I have created a custom object which converts data from a group of Foxpro 2.6 for DOS tables to a Visual Foxpro database. I have a form which has two progress bars and a command button to execute the conversion. When this form is executed, it instantiates the conversion object and assigns it to a property of the form. I want to update the progress bars in the form from the object. How can I reference the form from the object. I have used the syntax: _screen.forms().prgbarOverall...... I keep getting a error saying that "forms" is not an object. Any help is greatly appreciated.
Add a custom property (eg. oForm) to your custom object that will be used to store a reference to the Form (in the same way the Form is referencing the custom object).
You can pass a reference from the Form to the custom object via .Init as a parameter when you create the custom object, or assign it from Form prior to "running" the custom object.
eg:
THISFORM.oCustom = CREATEOBJECT( "My_Custom", THISFORM )
... and in the custom object's .Init()
PARAMETER toForm
THIS.oForm = m.toForm
*** OR ***
THISFORM.oCustom = CREATEOBJECT( "My_Custom" )
THISFORM.oCustom.oForm = THISFORM
Depending on when and where you destroy the custom object, release the reference to the Form first so you don't get into some sort of deadly embrace; eg.
<...>.oForm = .F.
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only