Hi there,
This is probably a pretty basic question, but I've just noticed that the execution order for my VB.NET app doesn't seem to be correct.
I've created a clean app with just proof of concept code to confirm that it occurs in a fresh project, and it does.
The code is...
When the form loads, the text box reads "Form opened" as expected. However, when you click Button1, there is a delay while the processing occurs, and then the text box reads "Post operation text".
It completely skips the "Pre-operation text", which I don't understand? Can someone please explain what I might be doing wrong?
This is probably a pretty basic question, but I've just noticed that the execution order for my VB.NET app doesn't seem to be correct.
I've created a clean app with just proof of concept code to confirm that it occurs in a fresh project, and it does.
The code is...
VB.NET:
Imports System.IO
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
TextBox1.Text = "Form opened"
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
TextBox1.Text = "Pre-operation text"
Dim i As Integer
i = 0
While i < 500
Directory.GetFiles("C:\Windows\System32")
i = i + 1
End While
TextBox1.Text = "Post operation text"
End Sub
End Class
When the form loads, the text box reads "Form opened" as expected. However, when you click Button1, there is a delay while the processing occurs, and then the text box reads "Post operation text".
It completely skips the "Pre-operation text", which I don't understand? Can someone please explain what I might be doing wrong?