双缓冲区 Compact Framework 中的自定义控件
我有一个继承自 Panel
的自定义控件。我最终在这个面板上放置了几个数据网格和标签。当它变得太长时,它会自动滚动给我。
我确实需要滚动,因为它是扫描的对象列表,其大小将大于屏幕上允许的空间。
但当我滚动时,它会闪烁很多。我很想让它给我一些平滑的滚动。
我见过几个“紧凑框架”双缓冲示例,但它们都是双缓冲绘制方法(即graphics.DrawString
)。我的自定义控件本身不进行任何绘画。它只是将普通网格和标签放在面板上,然后让面板绘制它们。
有没有办法双缓冲普通控件(同样不是自定义绘画)?
I have a custom control that inherits from Panel
. I end up putting several DataGrids and Labels on this panel. When it gets too long it auto scrolls for me.
I really need the scrolling because it is a list of scanned in objects that will grow larger than the space on the screen will allow.
But when I scroll it flickers quite a lot. I would love to have it give me some smooth scrolling.
I have seen several "Compact Framework" double buffer examples out there, but they all are double buffering draw methods (ie graphics.DrawString
). My custom control does not do any painting by itself. It just puts normal grids and labels on the panel and lets the panel paint them.
Is there a way to double buffer normal controls (again NOT custom painting)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Compact Framework 控件没有 DoubleBuffered 属性或底层双缓冲机制。也没有办法添加。
获得双缓冲的唯一方法是覆盖控件的绘制并执行您自己的操作。
The Compact Framework Controls do not have the DoubleBuffered property or the underlying double-buffering mechanism. There's no way to add it either.
The only way to get double-buffering is to override the painting of the control and do your own.