I have a form that is very slow because there are many controls placed on the form.
As a result the form takes a long time to loaded.
How do I load the fo
Another way of making "Loading screen" only display at certain time is, put it before the event and dismiss it after event finished doing it's job.
For example: you want to display a loading form for an event of saving result as MS Excel file and dismiss it after finished processing, do as follows:
LoadingWindow loadingWindow = new LoadingWindow();
try
{
loadingWindow.Show();
this.exportToExcelfile();
loadingWindow.Close();
}
catch (Exception ex)
{
MessageBox.Show("Exception EXPORT: " + ex.Message);
}
Or you can put loadingWindow.Close()
inside finally
block.