Public Declare Function SetCapture Lib "User32" (ByVal hWnd As Long) As Long
Public Declare Function ReleaseCapture Lib "User32" () As Long
Public Sub MouseExit(t As Variant, x As Single, y As Single)
On Error Resume Next
Dim MouseIn As Boolean
If (x >= 0) And (x <= t.Width) And (y >= 0) And (y < t.Height) Then MouseOut = True
If MouseIn Then
  SetCapture t.hWnd
  代码……
Else
  ReleaseCapture
  代码……
End IfEnd Sub在控件的mousemove事件里调用mouseexit函数

解决方案 »

  1.   

    最简单的方法就是..................使用VB.NET的mouse_leave不要生气啊?!你又没说VB.NET不是VB?!答对了就要给分,我的最简单
      

  2.   

    还有没有更简单的,要不使用API函数的。
      

  3.   

    譬如说用form_mousemove即可写入控件的mouse_leave,简单,呵呵,加分,:)
      

  4.   

    hhhhhhhhhhhhhhhhhhhhhVB.NET中根本就没有mouse_leave 只有....................
      

  5.   

    mouse move当没有了move 不就leave了???????