Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How can I Disable all the textboxes in a form?
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00187810
Message ID:
00188220
Views:
20
>Is there a way to acces the "enabled" property for all object of a certain kind, within a form? Or do I have to set the Enabled=.F. for each of the objects in the form.

So everyone (except Jim, whose answer was a little vague :) said use the Form.SetAll method. But as Barbara pointed out, that's a problem if you're using subclasses, and you want to change a property for everything that's a certain base class.

Since hopefully we're all moving toward using subclasses to some extent, I think it's useful to say that you can also use a little loop like this:
FOR lnObject = 1 TO Form.ControlCount
	IF PROPER(Form.Controls[lnObject].BaseClass) = "Textbox"
		Form.Controls[lnObject].Enabled = .F.
	ENDIF
ENDFOR
to perform your action on every object of a certain base class on your form.

Sorry I couldn't reply in Spanish ...

Cheers,
Rich.
Rich Addison, Micro Vane, Inc., Kalamazoo, MI
Relax, don't worry, have a homebrew.
- Charlie Papazian, The New Complete Joy of Home Brewing
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform