Display a form during cpu intensive task #2710
Unanswered
PlanetEarthSoftware
asked this question in
Q&A
Replies: 2 comments
-
To keep UI usable, any CPU intensive stuff needs to be done on separate threads. Using async/await works really well for this, for example this is how I would recommend doing something like this: private async void MainForm_Shown(object sender, EventArgs e)
{
MessageForm messageForm = new("busy", "test message");
messageForm.Closeable = false;
messageForm.Minimizable = false;
messageForm.Maximizable = false;
messageForm.Show();
await Task.Run(async () =>
{
await Task.Delay(10000);
// do actual CPU intensive work here.
});
messageForm.Close();
} |
Beta Was this translation helpful? Give feedback.
0 replies
-
I have found It would be nice if I could stop the menu and tool bars being active when |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is there a way to force Eto to layout and render a Form during a ᴄᴘᴜ intensive task; like Invalidate() for a Drawable.
Minimal example attached (65 lines total).
Thanks in advance for any assistance.
EtoCpuIntensiveTest.zip
Beta Was this translation helpful? Give feedback.
All reactions