gpt4 book ai didi

wpf - 相当于WPF中的SuspendLayout和ResumeLayout

转载 作者:行者123 更新时间:2023-12-04 20:29:01 24 4
gpt4 key购买 nike

具体场景。 ControlA 更改一个值,导致 ControlB(scrollviewer 的子类)重新配置其视口(viewport)、偏移量和范围,然后触发 ScrollableChanged 事件。 ControlB 还捕获“ScrollableChanged”事件并以编程方式滚动到确定的偏移量。如果我可以在更改值之前调用 suspendlayout 并在执行计算的滚动之后调用 resumelayout,这将创建这种可怕的双重重绘,这将完全避免。

我该怎么做?

最佳答案

来自 here :

Since layout is done in a separate pass it is implicitly blocked from updating while the UI thread is busy doing something else. Therefore you can add all the controls you want and change all the properties you want and the changes won't take effect until the UI thread returns.

关于wpf - 相当于WPF中的SuspendLayout和ResumeLayout,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/916162/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com