ATOUTFOX
COMMUNAUTÉ FRANCOPHONE DES PROFESSIONNELS FOXPRO
Visual FoxPro : le développement durable

Forum AtoutFox : Re: Problème avec This.Parent   

Sujet

rss Flux RSS des derniers messages

Vous devez vous identifier pour pouvoir poser une question ou répondre.

jeu. 04 avril 2013, 15h15
eddymaue
atoutfox.public.association

Re: Problème avec This.Parent

sous forme de code ça fonctionne bien

*********************************


Local ofrm

ofrm = Createobject("TestFrm")

Define Class TestFrm As Form

DoCreate = .T.
Add Object cstmTest1 As cstmTest

Procedure Init && of Test

This.AddObject("cstmtest2","cstmtest")

Endproc && Test :: Init

Procedure Destroy && of Test

Endproc && Test :: Destroy

Procedure Error(nError, cMethod, nLine) && of Test

Endproc && Error of Test

Enddefine

Define Class cstmTest As Custom

DoCreate = .T.

Add Object customtest1 As customTest

Procedure Init && of cstmTest

Set Step On
Wait This.Parent.Name Window Nowait

Endproc && cstmTest :: Init

Procedure Destroy && of cstmTest

Endproc && cstmTest :: Destroy

Procedure Error(nError, cMethod, nLine) && of cstmTest

Endproc && Error of cstmTest

Enddefine

Define Class customTest As Custom

DoCreate = .T.

Procedure Init && of customTest

set step on
Wait This.Parent.Name Window Nowait
Wait This.Parent.Parent.Name Window Nowait


Endproc && customTest :: Init

Procedure Destroy && of customTest

Endproc && customTest :: Destroy

Procedure Error(nError, cMethod, nLine) && of customTest

Endproc && Error of customTest

Enddefine





*********************************
Luc a couché sur son écran :
> Si pas encore résolu :
>
> si L"objet est créé avec Createobject("MaClasse"), This.Parent n'est pas
> défini. Si il est créé avec loFrm.AddObject("MonObjet", "MaClasse"),
> This.Parent devrait être défini.
>
> Luc

--
Merci de partager avec moi votre immense savoir que je me ferai plaisir
d'absorber...
il va de soi que je vais vous en laisser un peu
Politesse et savoir vivre oblige ;0)

Permalink : http://www.atoutfox.org/nntp.asp?ID=0000011691
20 286 messages dans le forum • Liste complète des messages

www.atoutfox.org - Site de la Communauté Francophone des Professionnels FoxPro - v3.4.0 - © 2004-2026.
Cette page est générée par un composant COM+ développé en Visual FoxPro 9.0-SP2-HF3