Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Passing the forms caption to the class object(container)
Message
De
05/03/2003 16:20:35
 
 
À
05/03/2003 16:13:54
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00761777
Message ID:
00761788
Vues:
20
Me again... just so you know, if your final item to receive the 'THIS.caption is in a container, just add another FOR..NEXT based on container base class....
*--myNewForm.Init

*-- For demo purposes, I will assume only your textbox objects have the property 'strcaption'
DODEFAULT()
lnObjects = AMEMBERS(laObjects, THIS, 2)
FOR lnCount = 1 TO lnObjects
 *-- Look at each member, but only look certain ones
 loObject = EVALUATE('THIS.' + laObjects[lnCount])
 *--
 *-- Here we have a container, so cycle it just like you would a form....
 *--
 IF UPPER(loObject.BaseClass) = 'CONTAINER'
  *-- remember, we need some new variables to work with... just increment the original for ease of use
  lnObjects1 = AMEMBERS(laObjects1, THIS, 2)
  FOR lnCount1 = 1 TO lnObjects1
   loObject1 = EVALUATE('THIS.' + laObjects1[lnCount1])
    IF UPPER(loObject1.BaseClass) = 'TEXTBOX'
      loObject1.strcaption = THIS.Caption
    ENDIF
  NEXT
NEXT
I do this all the time when I have certain global objects with specific properties....

Ric

>Rajender,
>
>The term "THISFORM" will not be valid until after THISFORM.init is completed. Remove any class reference property containing 'THISFORM', and replace with a generic class property definition, like "UNASSIGNED". Because you want the class property to be assigned by the current form (THISFORM), the current form should do the assigning. What you should do in the init of your form is this:
>
>
*--myNewForm.Init
>
>*-- For demo purposes, I will assume only your textbox objects have the property 'strcaption'
>DODEFAULT()
>lnObjects = AMEMBERS(laObjects, THIS, 2)
>FOR lnCount = 1 TO lnObjects
> *-- Look at each member, but only look certain ones
> loObject = EVALUATE('THIS.' + laObjects[lnCount])
> IF UPPER(loObject.BaseClass) = 'TEXTBOX'
>   loObject.strcaption = THIS.Caption
> ENDIF
>NEXT
>
>
>HTH
>
>Ric
>
>>I have a class object in the container (usercntl).
>>
>>i need to send the form name to the class objects usercntl - init event.
>>
>>when i am using strcaption = thisform.caption it is saying this form does'nt exist.
>>
>>how to get the forms caption in the usercntl class object.
>>
>>Thank you.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform