What if the interface is dead and flashes when Winform is refreshed?
This article mainly introduces the Winform refresh interface false death, flicker how to do, the article is very detailed, has a certain reference value, interested friends must read it!
1. Interface fake death
Start a new thread to do some calculations, and delegate to the form thread to update the interface only when the control is updated.
2.Winform flashes when refreshed
General
This.SetStyle (ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.ResizeRedraw, true)
Set double buffering, delayed refresh
In the case of OCC, when the robot frequently refreshes the screen, the form.Paint is declared to be called directly by public.
Note: calls to Refresh, Invalidate, and Update all empty the drawing before calling the Paint event, so there will be flickering.
OCC updates TopoDS objects, etc., do not need to be executed in the thread of Form, because the update is AIS_InteractiveObject, not the screen.
These are all the contents of this article entitled "how to fake death and flicker when Winform refreshes". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!