Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
BINDEVENT() question
Message
De
23/12/2004 11:20:48
 
 
À
23/12/2004 11:15:26
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00971804
Message ID:
00971809
Vues:
28
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform