Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
BINDEVENT() question
Message
From
23/12/2004 11:20:48
 
 
To
23/12/2004 11:15:26
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00971804
Message ID:
00971809
Views:
27
Opps. I should have read the threads today before posting this one. I saw the same question on another thread.

>Hi all,
>Is this normal behavior for BINDEVENT()? In the code snippet following, I have the Destroy event of clsFrm commented out. Run the code and click on the form's X button and the formset's CloseTbs() method will not fire. Then uncomment the forms Destroy procedure and the CloseTbs() method fires. I am running VFP8 with SP1.
>
>
>oFs = createobject('clsFs')
>read events
>
>define class clsFs as formset
>   otb = null
>   procedure init
>      this.AddObject('form1','clsFrm')
>      with this.form1
>         .height = 200
>         .width = 300
>         .show()
>      endwith
>      this.otb = newobject('clsTb')
>
>      bindevent(this.form1,'destroy',this,'closeTbs',1)
>      this.otb.show()
>   endproc
>
>   procedure closeTbs
>      wait window "delegate event called"
>      this.otb.release()
>      this.Release()
>   endproc
>
>enddefine
>
>define class clsFrm as Form
>*   procedure destroy
>*   endproc
>enddefine
>
>define class clsTb as Toolbar
>   add object cmd1 as clsCb
>enddefine
>
>define class clsCb as CommandButton
>   width = 26
>   height = 24
>   caption = "H"
>   visible = .t.
>enddefine
>
ramil
~~ learning to stand still
Previous
Reply
Map
View

Click here to load this message in the networking platform