c# – 我需要为每个子控件调用SuspendLayout吗?

前端之家收集整理的这篇文章主要介绍了c# – 我需要为每个子控件调用SuspendLayout吗?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
@H_404_1@找不到任何有关此信息.我的控件渲染速度非常慢,我注意到在进行主要更新时,我没有调用SuspendLayout.

我有疑问的是,由于顶级控件包含包含其他控件等的控件,因此在我的顶级控件中调用SuspendLayout也会挂起每个嵌套控件的布局,或者我需要为每个控件调用它们?

解决方法

看看这个MSDN文章Practical Tips For Boosting The Performance Of Windows Forms Apps.

Text from article : Remember that SuspendLayout only prevents Layout events from being performed for that particular control. If controls are added to a panel,for example,SuspendLayout and ResumeLayout must be called for the panel and not for the parent form.

原文链接:https://www.f2er.com/csharp/96021.html

猜你在找的C#相关文章