Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

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

2025-04-12 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

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!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report