对不起我的英文写作我是 VB.Net 的新手。我有一个按钮,它使用鼠标悬停和鼠标离开来更改图像,将图像背景设置为图片。问题是在事件之后加载图像时看起来很慢。有什么方法可以提高性能吗?
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Button1.BackgroundImage = My.Resources._1
End Sub
Private Sub Button1_MouseHover(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.MouseHover
Button1.BackgroundImage = My.Resources._2
End Sub
Private Sub Button1_MouseLeave(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.MouseLeave
Button1.BackgroundImage = My.Resources._1
End Sub