I have a Label
and PictureBox
element that in designer i set visibility as false
.
now i try this :
private void openExcelButton_Click(object sender, EventArgs e)
{
openExcelDialog.Filter = "Excel files|*.xls;*.xlsx;*.csv";
DialogResult result = openExcelDialog.ShowDialog();
if (result == DialogResult.OK) // Test result.
{
LoadingGIF.Visible = true;
LoadingLabel.Text = "Loading...";
LoadingLabel.Visible = true;
string file = openExcelDialog.FileName;
//more code
LoadingGIF.Visible = false;
LoadingLabel.Text = "Uploading Finished!";
}
}
Now when pressing the button and choosing a file nothing happens untill i finish the code in the //more code
section and then the label changes.
Why does this happen?