Okay, so I have this program I'm working on, and I was wondering if it was possible to disable/enable TextBoxes when specific words are wrtten. I tried doing this, but it errored. I'm a new programmer to VB, I just started a month ago, and I'm doing this for fun.

If TextBox1.Text = "Shutdown" then TextBox2.Enabled = True

I also want it so that you don't have to press a button to identify if it is the right text, so it could "scan" automatically.

If this is possible, please tell me, or if it's not, then tell me that :)

Thanks,
VBrulez

According to me, your code should work... If you could post more or the whole sub, then I could see it better.

As to your question about "scanning" the text box, simply use the TextChanged event procedure. If you are using VB.Net, then just double-click on the text box to access that event procedure.

Hope this helps!:)

Orignally posted by GregMaClean
How to Enable TextBoxes when specific text is entered?
According to me, your code should work... If you could post more or the whole sub, then I could see it better.

As to your question about "scanning" the text box, simply use the TextChanged event procedure. If you are using VB.Net, then just double-click on the text box to access that event procedure.

Hope this helps!

Yes it is possible and your code also seem to work
you can also try thi s which similar to your

If TextBox1.Text = "shut" Then
            TextBox2.Enabled = False
        ElseIf TextBox1.Text = "start" Then
            TextBox2.Enabled = True
        End If

Thanks!

Then mark this thread as solved

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.