VB如何通过鼠标移动来改变图片样式?
当鼠标移动到image1上的时候,image2.Visible=True,当鼠标移动离开image1的时候,image2.Visible=Flase?...
当鼠标移动到image1上的时候,image2.Visible = True ,当鼠标移动离开image1的时候,image2.Visible = Flase ?
展开
展开全部
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If (X >= Image1.Left) And (X <= Image1.Left + Image1.Width) And _
(Y >= Image1.Top) And (Y <= Image1.Top + Image1.Height) Then _
Image1.Visible = True
End Sub
Private Sub Image1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Image1.Visible = False
End Sub
If (X >= Image1.Left) And (X <= Image1.Left + Image1.Width) And _
(Y >= Image1.Top) And (Y <= Image1.Top + Image1.Height) Then _
Image1.Visible = True
End Sub
Private Sub Image1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Image1.Visible = False
End Sub
展开全部
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Image2.Visible = False
End Sub
Private Sub Image1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Image2.Visible = True
End Sub
注意:使用上面方法时,image1控件应与其他控件没有重叠。如果有重叠的话,应在该重叠控件的MouseMove语句中添加Imge2.Visible=false
Image2.Visible = False
End Sub
Private Sub Image1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Image2.Visible = True
End Sub
注意:使用上面方法时,image1控件应与其他控件没有重叠。如果有重叠的话,应在该重叠控件的MouseMove语句中添加Imge2.Visible=false
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询