关键是解决MOUSE移出问题
在MOUSE移出时,系统会发出一个MOUSE移动事件,也就是你在MOUSE移动事件中检测MOUSE当前位置,如果不在目标区域内则表示MOUSE移出,否则表示移入

解决方案 »

  1.   

    用两个图片框,一个mouse on时show,一个mouse out 时show!
      

  2.   

    你需要两个图片 c:\1.jpg c:\2.jpg
    三个Picturebox
    Dim aaa
    Private Sub Form_Load()
    Picture2.Picture = LoadPicture("c:\1.jpg")
    Picture3.Picture = LoadPicture("c:\2.gif")
    Picture2.Visible = False
    Picture3.Visible = False
    Picture1.Picture = Picture3.Picture
    aaa = 1
    End SubPrivate Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If aaa = 1 Then
    Picture1.Picture = Picture2.Picture
    aaa = 2
    End If
    End SubPrivate Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If aaa = 2 Then
    Picture1.Picture = Picture3.Picture
    aaa = 1
    End If
    End Sub
      

  3.   

    Dim aaa
    Private Sub Form_Load()
    Picture2.Picture = LoadPicture("c:\1.jpg")
    Picture3.Picture = LoadPicture("c:\2.jpg")
    Picture2.Visible = False
    Picture3.Visible = False
    Picture1.Picture = Picture3.Picture
    aaa = 1
    End SubPrivate Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If aaa = 1 Then
    Picture1.Picture = Picture2.Picture
    aaa = 2
    End If
    End SubPrivate Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If aaa = 2 Then
    Picture1.Picture = Picture3.Picture
    aaa = 1
    End If
    End Sub
      

  4.   

    Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If button = 1 Then
    Picture1.Picture = loadpicture("图片1")
    End If
    End SubPrivate Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    if button=1
    Picture1.Picture = loadpicture("图片2")
    End If
    End Sub
      

  5.   

    捕捉MouseExit事件 
     
    Private Declare Function SetCapture Lib "user32" (ByVal hWnd As Long) As Long
    Private Declare Function ReleaseCapture Lib "user32" () As Long Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) 
    With Picture1 
        If Button = 0 Then
        If (X < 0) Or (Y < 0) Or (X > .Width) Or (Y > .Height) Then
              ReleaseCapture  
              ' 放入鼠标离开的代码
        Else
              SetCapture .hwnd
              ' 放入鼠标进入的代码
        End If 
    End With
      

  6.   

    谢谢cnthinking(e塔)。功能已经实现,马上加分,我想再问一下,如果针对象标签等没有句柄的对象,这些功能能实现吗?
      

  7.   

    在image的mousemove例判断就可以
      

  8.   

    换图片的时候要采用bitble来实现,否则闪烁太厉害