当RectangleShape调整大小时停止闪烁 [英] Stopping flickering when RectangleShape resizes
问题描述
您好,
我正在制作一个自定义进度条,其中有灰色背景(2),进度矩形(1)为蓝色。为了显示正在进行的进度,进度矩形的宽度增加(见图表)。
_____________________
| | |
| 1 | - > 2 |
| ____________ | ________ |
问题是,即使使用以下代码,进度矩形也会闪烁:
我 .SetStyle(ControlStyles.UserPaint, True )
Me .SetStyle(ControlStyles.AllPaintingInWmPaint, True )
我 .SetStyle(ControlStyles.DoubleBuffer, True )
进度矩形的宽度被编码为在间隔100ms的定时器上增加1到400.
请帮忙。我找不到任何其他答案,我不想创建一个flash动画。
-Rixterz
这可能很有用:
SO:为什么我的WinForms控制闪烁并缓慢调整大小? [ ^ ]
你能告诉我们方法吗重写OnPaint()?
Dim g as graphics = me.creategraphics - > e.graphics ...
Hello,
I'm making a custom progressbar where there is a gray background (2) and the progress rectangle (1) is blue. To show progress being made, the progress rectangle increases in width (see diagram).
_____________________
| | |
| 1 |--> 2 |
|____________|________|
The problem is that even with the following code, the progress rectangle flickers:
Me.SetStyle(ControlStyles.UserPaint, True)
Me.SetStyle(ControlStyles.AllPaintingInWmPaint, True)
Me.SetStyle(ControlStyles.DoubleBuffer, True)
The progress rectangle's width is coded to increase by 1 up to 400 on a timer with the interval 100ms.
Please help. I can't find any other answers and I don't want to have to create a flash animation.
-Rixterz
That could be useful:
SO: Why do my WinForms controls flicker and resize slowly?[^]
Could you show us the method overriding OnPaint()?
Dim g as graphics= me.creategraphics --> e.graphics...
这篇关于当RectangleShape调整大小时停止闪烁的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!