VB.NET中如何实现当鼠标移动到按钮上,按钮的背景图片就变换一张,鼠标移开,又变回原来的背景图。 20
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Button1.BackgroundImage = My.Resources.a
End Sub
Private Sub Button1_MouseEnter(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.MouseEnter
Button1.BackgroundImage = My.Resources.b
End Sub
Private Sub Button1_MouseLeave(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.MouseLeave
Button1.BackgroundImage = My.Resources.a
End Sub
End Class
当然,你先得制作两张大小一样的图片