简体   繁体   English

组件在运行时闪烁设计 winform c#

[英]Component flickering at runtime design winform c#

I want to develop a win form application which allows updating the design at run time.我想开发一个允许在运行时更新设计的 win 表单应用程序。 So I add a generic design form using Designer Host and DesignSurface to add Root component and other components from the caller form, then I can change the locations and properties of components and update back to the caller form.所以我使用 Designer Host 和 DesignSurface 添加一个通用设计表单,从调用者表单中添加 Root 组件和其他组件,然后我可以更改组件的位置和属性并更新回调用者表单。 It works fine if I add the design form on the same project with other forms.如果我将设计表单与其他表单添加到同一个项目中,则效果很好。 Now I want to split the design form to a separate project (Windows Forms Control Library) so I can pack this design form and other design classes to a DLL and the main project can have a reference to this DLL.现在我想将设计表单拆分为一个单独的项目(Windows 窗体控件库),以便我可以将这个设计表单和其他设计类打包到一个 DLL 中,并且主项目可以引用这个 DLL。 However, the design form starts flickering when I add root components and other components.但是,当我添加根组件和其他组件时,设计表单开始闪烁。 I have tried to add double buffering to design form but this issue cannot be solved.我曾尝试在设计表单中添加双缓冲,但无法解决此问题。 Does anyone have a solution for this?有没有人对此有解决方案?

After upgrading Visual studio 2019 from 16.6 to 16.7.2, this issue has been solved.将Visual Studio 2019 从16.6 升级到16.7.2 后,此问题已解决。 It seems that some memory management has been improved but i am not so sure.似乎某些内存管理已得到改进,但我不太确定。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM