Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Datasessions - thisform.release
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00090329
Message ID:
00094862
Views:
33
Hi Nick, hope you don't mind me returning after so long to this question. I use VB and VBA a tiny bit at work and once I've assigned a variable to an object I can use it pretty much like "Thisform" which I'd expected to be able to do in VFP. The With..EndWith doesn't seem that much of an advantage - or have I missed the point?
regards - Sarah

>>Question re the text above. Where should I create myVar1 if I want it to be private to a form? In the init code? This could be good for references to grids on page frames and the like. Gives me a way of extending the "This" and "Thisform" concept?!
>>
>>Thanks again - Sarah
>
>If you want to make it private to the form you need to add the property say, oGridCustomers to the form. Then in form.Init() you may assign your grid to it:
>thisform.oGridCustomers = thisform.pgfPageFrame1.Page2.grdCustomers
>and then anywhere in code you may for example set and reset grid properties like:
>
>WITH thisform.oGridCustomers
>   .RecordSource = "customers"
>   .Column1.ControlSource = "customers.firstname"
>   .Column2.ControlSource = "customers.lastname"
>   .Column3.ControlSource = "customers.address"
>*** more code here***
>ENDWITH
>
>Don't forget to reset thisform.oGridCustomers to .NULL. in form.Destroy()
>You can also assign your objects to the properties in application object, or create special "exchange object", so your forms can communicate through it.
>
>Nick
Sarah King
pcpropertymanager.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform