simonkwan
December 20th, 1999, 02:38 AM
Hi,
Is there any convenient way to set the enabled property to false for all textbox in my form ?
Thank you !
Chris Eastwood
December 20th, 1999, 03:03 AM
You could use this as a general way of enabling / disabling all the textboxes on a passed form :
private Sub EnableTextBoxes(frm as Form, byval bEnable as Boolean)
Dim ctl as Control
for Each ctl In frm.Controls
If TypeOf ctl is TextBox then
ctl.Enabled = bEnable
End If
next
End Sub
So you could call it with :
EnableTextBoxes Form1, false
'
' or - from within Form1
'
EnableTextBoxes me, false
Chris Eastwood
CodeGuru - the website for developers
http://codeguru.developer.com/vb