- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
具体场景。 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/
我查看了 Form 和 UserControl 生成的设计器代码,在 InitializeComponent() 方法中它们总是以 this.SuspendLayout(); 结束于
我使用这两个函数suspendLayouts和resumeLayouts来优化大型网格渲染。特别是,我在以编程方式隐藏一些网格列之前和之后使用它们。我这样做是这样的: Ext.suspendLayou
我有一个包含一些“自定义控件”的库。本质上,我们有自己的按钮、圆角面板和一些带有一些自定义油漆的组框。尽管 OnPaint 方法中有“数学”,但控件非常标准。大多数时候,我们所做的只是绘制圆角并向背景
我有两个托管 TableLayoutPanel 的选项卡页面,我用标签和文本框动态填充它们。第一个有 96 个标签和 96 个文本框,它的闪烁是可以接受的/可以忍受的,所以我没有费心添加 Suspen
我的程序有提示错误。我不明白这是什么意思。它与 this.ResumeLayout(false); ==> frominloggen 有关 弹出的窗口是这样说的: An unhandled excep
我需要向一个父控件添加很多控件。 但我发现如果在将这些控件添加到父级之前和之后添加 ParentControl.SuspendLayout 和 ParentControl.ResumeLayout,我
我想不出如何准确地表达这个问题,但希望我的意思是清楚的。 Control.SuspendLayout 和 Control.ResumeLayout 会计数吗? 换句话说,如果我调用两次 Suspend
有人可以解释一下使用 ISupportInitialize 接口(interface)方法(BeginInit/EndInit)和使用 SuspendLayout/ResumeLayout 之间的区别
我正在用 C# 构建一个 Windows 窗体应用程序,并且在 Windows 7 64 位上进行的测试显示无提示崩溃。 它失败的确切行是 this.ResumeLayout(false); 靠近 I
如果我在后面的代码中的一个函数中,并且我想实现在状态栏中显示“正在加载...”,那么以下是有意义的,但正如我们从 WinForms 中知道的那样是一个 NoNo: StatusBarMessageTe
我是一名优秀的程序员,十分优秀!