Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ReallyBusyForm.Show();
- ReallyBusyForm.Focus();
- var floatingWindow = new FloatingLoadingWindow();
- Task.Run(() => floatingWindow.ShowDialog());
- await Task.Run(() => ReallyBusyForm.LoadYourControls());
- Invoke((MethodInvoker)(() =>
- {
- while (Application.OpenForms["FloatingLoadingWindow"] == null)
- {
- Thread.Sleep(200);
- }
- floatingWindow.Close();
- }));
- floatingWindow.ShowDialog(); //this call obviously block the execution of what comes next
- await Task.Run(() => ReallyBusyForm.LoadYourControls());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement