MB Software Solutions, LLC wrote on 2012-11-08:
> I've got a form where some labels should appear in the TOP of the object
> hierarchy and hence instantiate before some other objects that depend on
> them to have a custom property. Without the proper order, some other
> objects encounter an error because the Init of those labels didn't yet
> happen to create a custom property on them.
>
> Is this something I have to hack the SCX to achieve? I tried deleting
> and re-adding the objects but that didn't help. I'm guessing it has
> something to do with the timestamp in the SCX?
>
> tia,
> --Mike
>
>
Mike,
If your labels are on the form, not in containers you could use the SETALL()
method of the form to call a method in the label. This was VFP 6 days for
me.
If you have containers, this is a good use of BINDEVENTS.
To use BINDEVENTS you need to have 2 methods on the label class.
FormInitEvent
FormInitMethod
Procedure FormInitEvent
THIS.FormInitMethod()
EndProc
Procedure FormInitMethod
** Your code goes here
EndProc
Procedure Init
BINDEVENT(THISFORM, "INIT", THIS, "FORMINITEVENT")
EndProc
If you call the method directly, anticipate strange behavior.
Once in the FormInitMethod procedure you can access objects outside of the
label. Inside the FormInitEvent, it is hit or miss. In my experience, it is
usually a miss in the runtime.
I do not expect any object on the form to exist until the form gets to its
INIT method.
Tracy Pearson
PowerChurch Software
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message:
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the
author, and do not constitute legal or medical advice. This statement is added
to the messages for those lawyers who are too stupid to see the obvious.