Visual Studio C# .NET 5.0 Windows Forms App
Im trying to change a label in my windows form app before performing a ping command but its doesn't work as intendet.
This is my code:
`//some other code
label1.Text = "Pinging specified target... Please wait.";
PingReply reply = ping.Send(target);
label1.Text = "";
//some other code`
The code should change the text of an empty label to "Pinging specified target... Please wait." then run the ping function and then change the label back to blank text.
What happens is, the label only changes after the ping function finished. When i remove the code that changes the label to blank text, the label says "Pinging specified target... Please wait." but only after the ping function ran to completion.
Why does the label change after the ping function when the code is written before the ping function?