Disable all Controls

sturner333

Member
Joined
Jun 20, 2008
Messages
9
Programming Experience
3-5
I have a form with a 4 page tab control. Each page of the tag control has components on them(texboxes, comboboxes, etc). Is there a simple way to make all the controls except the tab control read only or non-modifiable?
Thanks
 
That depends, do you want to do it during designtime or runtime? Each control has an .Enable property that you can set as you create them, in the property window. Or you could use - this would disable all of them;
VB.NET:
For Each ctr as Control In Me.Controls
   ctr.Enabled = False
Next

Textboxes have the readonly property you
can set them either way.
 
Back
Top