我非常想了解具有 png 透明背景图像的面板和按钮如何随着时间和/重新缩放在 location.X 和 location.Y 中移动而无需更新透明子按钮或子按钮中的父背景图像面板控制。
这是我用来使鼠标进入鼠标离开滑动面板的代码
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
If entered = True Then
Panel4.Width += 1
'or you can use Location.new point.......
if Panel4.Width>= 100 then
Panel4.Width = 100
entered = false
End If
End If
If exited = True Then
Panel4.Width -= 1
if Panel4.Width< 10 then
Panel4.Width = 10
End If
End If
Private Sub Panel4_MouseEnter(sender As Object, e As EventArgs) Handles Panel4.MouseEnter
exited = False
entered = True
Timer1.Start()
End Sub
Private Sub Panel4_MouseLeave(sender As Object, e As EventArgs) Handles Panel4.MouseLeave
entered = False
exited = True
Timer1.Start()
End Sub
如果表单有背景,那么每次面板移动时,它必须用表单的背景图像更新自己的背景图像,以产生透明的错觉,导致面板滑动时看起来像故障,正确?
有没有办法让过渡顺利进行?
不幸的是,实际问题的照片将无济于事