|
-
January 23rd, 2003, 03:47 AM
#1
I have a fixed size number of controls ( textBox ) and I need to disable some of them
-
January 23rd, 2003, 10:00 AM
#2
Be more specific
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|