简体   繁体   English

在Compact Framework中双缓冲自定义控件

[英]Double Buffer a custom control in the Compact Framework

I have a custom control that inherits from Panel . 我有一个自Panel继承的自定义控件。 I end up putting several DataGrids and Labels on this panel. 最后,我在此面板上放置了几个DataGrid和Labels。 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 ). 我已经看到了几个“紧凑框架”双缓冲区示例,但是它们都是双缓冲绘制方法(即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)? 有没有办法对普通控件加倍缓冲(再次不是自定义绘画)?

The Compact Framework Controls do not have the DoubleBuffered property or the underlying double-buffering mechanism. 紧凑框架控件不具有DoubleBuffered属性或基础的双缓冲机制。 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. 获得双缓冲的唯一方法是覆盖控件的绘制并自己完成。

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

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