VB2005中picturebox的使用问题
VB中若要把鼠标放在picturebox1上,picturebox1中的1.jpg就变成2.jpg,然后点下鼠标,2.jpg就变成3.jpg,松开鼠标3.jpg变回1.j...
VB中若要把鼠标放在picturebox1上,picturebox1中的1.jpg就变成2.jpg,然后点下鼠标,2.jpg就变成3.jpg,松开鼠标3.jpg变回1.jpg并且完成事件:text1.text=“Finish!”
展开
3个回答
展开全部
Public Class Form1
Private Sub PictureBox1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseDown
PictureBox1.Image = System.Drawing.Image.FromFile("C:\3.bmp")
End Sub
Private Sub PictureBox1_MouseEnter(ByVal sender As Object, ByVal e As System.EventArgs) Handles PictureBox1.MouseEnter
PictureBox1.Image = System.Drawing.Image.FromFile("C:\2.bmp")
End Sub
Private Sub PictureBox1_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseUp
PictureBox1.Image = System.Drawing.Image.FromFile("C:\1.bmp")
End Sub
End Class
Private Sub PictureBox1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseDown
PictureBox1.Image = System.Drawing.Image.FromFile("C:\3.bmp")
End Sub
Private Sub PictureBox1_MouseEnter(ByVal sender As Object, ByVal e As System.EventArgs) Handles PictureBox1.MouseEnter
PictureBox1.Image = System.Drawing.Image.FromFile("C:\2.bmp")
End Sub
Private Sub PictureBox1_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseUp
PictureBox1.Image = System.Drawing.Image.FromFile("C:\1.bmp")
End Sub
End Class
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询