Get the App
SLTechnology News&Howtos  ›  Development  › 

What if the interface is dead and flashes when Winform is refreshed?

Shulou Source: shulou.com Published: 2022-06-02 11:32:18 09月30日 Update

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!

Tags: Interface update thread how to do content screen article frequency event value interest action only object partner control is in more machine Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MariaDB Shulou Technology macOS MySQL Huawei