Winforms ProgressBar Takes time to Render

前端 未结 7 1703
清歌不尽
清歌不尽 2021-01-15 10:12

I have noticied that when using the PorgressBar. If I set the value to x, the value displayed is not immediately updated, it takes a small amount of time to draw it as the b

7条回答
  •  Happy的楠姐
    2021-01-15 10:58

    I have a similar problem. I would prefer to sue the standard progress bar in order to have a typical design in the application.

    It is true that it needs time to update, and since DoEvents does not work on its own, I would recommend to do the loading by using a backgroundworker. When finished and it still doesn't work, then either add a doevents, or a small delay. But I guess your solution to ad a delay of 100ms would be best, since it requirest the fewest changes and is still working. what about just adding 10ms delay to it. The other way would be: try progressBar.Invalidate (force a repaint), add code to paint, which checks if paint is executed, and then close the form. I guess DoEvents won't work in paint, since paint needs to finish. so you could enabl a timer with 100ms interval and it would close the window.

    about everything less 1/24s is invisible for humans is bu..sh.. there are liquids in the eye which see even mcuh shorter things. It is a difference if we can immediately react to something, but since the information is 'burned' on the surface of the eyes until it will be 'read' by nerves, it is not lost. there are even problems with 60Hz, and I am sure most people know that annoying 60Hz crt problem. LCD does not flicker that intense, but if you need a high framerate, and 60 is not enough, then you can still 'see' the problems with 60 and it looks mcuh better with 100 or higher.

提交回复
热议问题