如何减少vb2005面板中的闪烁? 在父面板内部,我有2个其他面板,我正在使用。当您更改面板中的图像时减少闪烁
最外面的面板包含一个背景精灵,两个最内面的面板是覆盖层,可以更改为适合背景精灵中的位置。
当我改变覆盖精灵时,我想减少闪烁并使其从一个精灵平滑过渡到下一个精灵。
下面是改变 覆盖面板没有改变的覆盖面板上的图像的代码,如果新的值是一样的旧值
Private Sub TrackBar2_Scroll(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TrackBar2.Scroll, TrackBar1.Scroll
If (Panel2.Tag <> TrackBar1.Value) Then
Panel2.Tag = TrackBar1.Value
Panel2.BackgroundImage = tops(TrackBar1.Value) //img array for the top panel
Panel2.Update()
End If
If (Panel3.Tag <> TrackBar2.Value) Then
Panel3.Tag = TrackBar2.Value
If (TrackBar2.Value > 0) Then
Panel3.Location = New Point(182, 210)
Else
Panel3.Location = New Point(182, 209)
End If
Panel3.BackgroundImage = bottoms(TrackBar2.Value)//img array for the bottom panel
Panel3.Update()
End If
有趣的方法 – Jim 2009-05-05 00:34:11