Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

Set focus to a text box on a web page after textchanged event...

Avatar of Bran-Damage
Bran-DamageFlag for United States of America asked on
.NET ProgrammingASP.NETVisual Basic.NET
4 Comments1 Solution398 ViewsLast Modified:
I have an aspx page that has text boxes.  On one of my text boxes I have a changedText event.

After the changed text event the cursur goes to an undesirable location.

I tried to do a me.txtph.focus() but that did not work.

What I am looking to do is either go to me.txtph or put the cursur when they hit tab to the next tab order or when they click on a different field, keep the cursur there.

Any ideas would be helpful.

I have attached my changed text event code.
Protected Sub txtstate_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs)

            If Me.txtstate.Text = "AE" Or Me.txtstate.Text = "AA" Or Me.txtstate.Text = "AP" Then

                If TxtdelDoc.Text <> "" And TxtFromCountry.Text <> "" And txtcountry.Text <> "" Then
                    btnInternational.Enabled = True
                End If

                btnInternational.Enabled = False
            End If

        Catch ex As Exception

        End Try
    End Sub
Avatar of Robb Hill
Robb HillFlag of United States of America imageSenior .Net Full Stack Developer

Our community of experts have been thoroughly vetted for their expertise and industry experience.

This problem has been solved!
Unlock 1 Answer and 4 Comments.
See Answers