Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Bindevent to a property not fire with resetToDefault
Message
 
 
To
16/10/2003 12:01:49
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00839329
Message ID:
00839351
Views:
17
This is just a wild assumption on my part, but after reading the VFP Help file on BindEvents PLUS the following from the ResetToDefault topic in the VFP Help file:

ResetToDefault does not apply to Access/Assign methods since these are tied more closely to their associated property and therefore are treated differently than normal methods.

I think this is by design. Try this demo code instead:
loTest = CREATEOBJECT("_label")
BINDEVENT(loTest, 'ResetToDefault', loTest, 'ResetFired', 1)
BINDEVENT(loTest, 'Caption', loTest, 'ChangeCaption', 1)
WITH loTest
   WAIT WINDOW "Caption = " + .Caption TIMEOUT 2
   .Caption = "Retest"
   .ResetToDefault('Caption')
   WAIT WINDOW "Reset Complete. Caption = " + .Caption TIMEOUT 2
ENDWITH

DEFINE CLASS _label AS label

   PROCEDURE ResetFired
      LPARAMETERS tuDummy
      WAIT WINDOW 'ResetToDefault fired' TIMEOUT 3
   ENDPROC
   PROCEDURE ChangeCaption
      WAIT WINDOW 'Caption Changed - Caption = ' + THIS.Caption TIMEOUT 3
   ENDPROC
   
ENDDEFINE
>Hi,
>
>is this a VFP by design behaviour ?
>
>Fabio
Mark McCasland
Midlothian, TX USA
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform