Changing one form's properties from a different form 
Author Message
 Changing one form's properties from a different form

I'm running form2    from    form1.   When in form2, I need to change one of
the properties on the calling form (form1).  Can someone explain how to do
this?

Thanks,

Keith



Wed, 08 May 2002 03:00:00 GMT  
 Changing one form's properties from a different form

Quote:

> I'm running form2    from    form1.   When in form2, I need to change one of
> the properties on the calling form (form1).  Can someone explain how to do
> this?

Here is one method :

add a property ioCallingForm to your form's base class

when calling Form2 from form1 :

DO FORM form2 WITH this && passing a reference to the calling form

In form2 init :

LPARAMETERS toCallingForm
this.ioCallingForm = toCallingForm && storing reference to the calling form in
a property of the called form

now you can read/set any property of the calling form, or run any of its
method from anywhere in your called form :

this.ioCallingForm.MyProperty = MyValue
this.ioCallingForm.myMethod()

another method consists in using a forms manager object, which holds
references to all active forms

Christian Desbourse (Belgium)



Wed, 08 May 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. - changing form object properties with refresh method - beginner's question

2. Changing from one form to an other form.

3. Top Level Form, Menus and Form's Properties

4. Can't reference on forms properties from another form

5. List boxes in VFP 6.0 - selected property won't set in form's init

6. Q: Cursor's Exclusive property in a form's datasession

7. Why can't I point form at different database

8. Help: Form.Refresh() doesn't work for active form if mutiple forms on screen

9. Changing properties of all controls on a form ?

10. Changing properties of all controls on a form

11. Width of Form in Property window changes

12. How to change fonts property for a form ?

 

 
Powered by phpBB® Forum Software