本文介绍了降低.NET FlowLayoutPanel的闪变的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我清理和添加多个的LinkLabel的到FlowLayoutPanel的,每两秒钟。它工作正常,但闪烁是相当明显的。有什么办法来减少呢?我试图设置Form.DoubleBuffering,它并没有帮助。

I'm clearing and adding multiple LinkLabel's to FlowLayoutPanel, every couple of seconds. It works fine, but flicker is quite noticeable. Is there any way to reduce it? I tried to set Form.DoubleBuffering, it didn't help.

推荐答案

管理通过从FlowLayoutPanel的派生的自定义控制,并设置其样式,如下所示:

Managed by creating a custom control derived from FlowLayoutPanel and setting its styles as shown below:

公共类CustomFlowLayoutPanel      继承FlowLayoutPanel的

Public Sub New()
    MyBase.New()

    SetStyle(ControlStyles.UserPaint, True)
    SetStyle(ControlStyles.AllPaintingInWmPaint, True)
    SetStyle(ControlStyles.DoubleBuffer, True)

End Sub

    

末级

End Class

这篇关于降低.NET FlowLayoutPanel的闪变的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-18 18:23