Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Passing object reference to a new form
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00322790
Message ID:
00322802
Views:
26
>I've got a form I'm working on where on the "parent" form I've got an object instanced called oNotation - it has the properties of cUserID and cMessage (among others). When the user clicks on an Add button I open a new form and pass the oNotation object reference to the new form. I'd like to bind some of the controls directly to the properties of oNotation but can't since the object reference isn't valid until it hits the Init() of the form. I can work around the problem by recreating the oNotation properties on the form, then binding to those instead (of course, copying the oNotation property values to the form and back again when they save). But I was wondering if there was any other ways of handling this - mostly out of curiosity I guess.

You could put access and assign methods on the form properties (which are bound to your controls) that look at the oNotation object (via the passed reference) for the values.

Another thing you can do is populate the control sources of the controls in the Init() of the form...

Another thing you could do is use the method Kevin McNiesh wrote about in his January FA article. Basically the same as above, but instead of the code being in the init of the form, you put it in the 'event' of the controls and 'raise' the event in the init() of your form.

HTH,

BOb
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform