Thanks, Udi
Printable View
Thanks, Udi
You need to be more specific.
textbox1.Enabled = False
that's the easy way.
to completely remove it from view:
TextBox1.Visible = False
Here is a more complex example that will allow you to go through all the boxes on a given form and allow you to do what ever you need to. For example check the text to see if it should be disabled.
Dim aControl As Control
For Each aControl In Me.Controls
If (aControl.GetType().ToString().Equals("System.Windows.Forms.TextBox")) Then
'code to text boxes here.
'use aCountrol to get to properties.
aControl.Enabled = False
End If
Next
This is not the best method, but it will work. You could also use the typeof() function.
Good luck