Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
CheckBox and TextBox enable/disable Code Placement
Message
From
29/01/2002 23:49:58
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00612601
Message ID:
00612604
Views:
26
>Hi All,
>
>On a form I have a check box which will enable/disable two textboxes according to the checkbox state. This has also to relect when the records pointer is moved.
>
>I have codes in the refresh of the textbox like
>
>this.enabled = !thisform.chkbox.value
>
>
>and in the check box I have:
>
>thisform.textbox1.refresh()
>thisform.textbox2.refresh()
>
>
>now if I add a new control which depends on this checkbox I'll have to code two places again. Any way I can co-ordinate things well from one place and fixed codes in say for eg. the checkbox, so when I add a new control I have to change at one place to get the desired effects.

The easy way, assuming that there are no side effects that you want to avoid, is simply:
Thisform.Refresh()
This command sets off the Refresh() method in every object on the form.

If there are other global effects of that code that you need to avoid, you can also create a Container that the textboxes would reside in. In the Refresh() of the container, you would have code something like this:
FOR EACH loObject IN This.Controls
    loObject.Refresh()
NEXT
Then you would just fire:
Thisform.cntBoxes.Refresh()
David M. Stowell
Ravenslake Consulting
Chicago, Illinois

e-mail: davidstowell@ravenslakeconsulting.com
Previous
Reply
Map
View

Click here to load this message in the networking platform