Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Passing the forms caption to the class object(container)
Message
From
05/03/2003 16:13:54
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00761777
Message ID:
00761784
Views:
28
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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform