How to make windows with UI responsive?

This is a common problem for all developers, I’m looking for the best solution for creating a Windows Forms user interface.

I have an animated GIF file to show the progress of my calculation on a Windows form. I took an image control and placed an animated gif in it. now, when my calculation begins, the animated gif freezes. I want the opposite, the animation should be visible when I start the calculation.

Any points of thought? A simple solution is to display a progress bar for the user when performing complex calculations behind the scenes.

My application is a single-threaded application, and I want a simple solution without looking for multi-threaded or background working technologies.

Any help?

+3
source share
5 answers

A lot of threads would be my recommendation. A bit messy the first time you try;)

The simplest model: one thread for the graphical interface and one thread for any work that you need to do.

Check this link .

+9
source

Application.DoEvents

You put it in a loop. This gives the UI time to complete its tasks.

+5
source

, 2 (, ) - . , , - , . , Application.DoEvents, .

+3
+2

"a simple solution for displaying progress to the user when performing complex calculations behind the scenes?"

"Doesn't look for multi-threading, or working-type background technologies."

Which of these wishes is more important to you? You will have to choose one or the other.

+2
source

Source: https://habr.com/ru/post/1698308/


All Articles