Link to home
Start Free TrialLog in
Avatar of NursingCorp
NursingCorpFlag for United States of America

asked on

VB.NET Order of Events

I have some code in a button click event that run some SQL and returns data. When the button is clicked, I want the label text to say "Please Wait ... running query." The problem is that my label text does not change, it just jumps right into running the query - it is as if it skips changing the label. If I remove the code that comes after the label text change, then it works properly. How do I get it to change the label text first - then run the additional code?
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Label6.Text = "Please Wait ... running query"

        Try
            [My Additional Code is here]
        Catch Ex As Exception
            Label6.Text = Ex.ToString
        End Try

End Sub

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Craig Wagner
Craig Wagner
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial