Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to change, refresh and coordinate object's propertie
Message
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
00181661
Message ID:
00181831
Views:
9
Hi Juan,

In your form, add a method called refreshall(), or something like that, and reset all of your forms object properties from there. Instead of having code in many methods, you can contain all of your code in one and just call the refreshall()method. I use this technique in most of my forms and it works great and is easier to maintain when you make changes to your form.

HTHs

John.

>I hope somebody can understand me:
>
>My app is more complex every day. I have to control and coordinate object's properties (i.e. enabled and read_only) depending on certain conditions evaluated from fields in tables.
>
>An example:
>
>I use to write this code in my grids.afterrowcolchange method.
>(Just an example):
>
>
>if mytable.field1 = 1
>
> thisform.pageframe1.page1.command1.enabled = .f.
>
> thisform.text1.readonly = .t.
> .
> .
> .
>else
>
> thisform.pageframe1.page1.command1.enabled = .t.
>
> thisform.text1.readonly = .f.
> .
> .
> .
>endif
>
>thisform.refresh()
>
>
>** Many times, conditions include more variables or fields.
>
>Is this a good technique? Or should i write the refresh method for every object evaluating conditions and changing its properties?
>
>Example:
>
>Afterrowcolchange method for MyGrid:
>
>thisform.refresh()
>
>
>
>Refresh method for thisform.text1:
>
>if mytable.field1 = 1
> this.readonly = .t.
>else
> this.readonly = .f.
>endif
>
>
>
>
>
>
>Please, any ideas, articles or examples (Not Tastrade).
>
>
>Thank you.
>
>Juan Carlos.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform