http://zyl910vb.51.net/vb/gui/MouseLeave.htm右击连接,目标另存为
注意把下载后的*.zip.jpg改名成*.zip

解决方案 »

  1.   

    可以参考一下:Option ExplicitPrivate Declare Function DrawEdge Lib "user32" (ByVal hdc As Long, qrc As RECT, ByVal edge As Long, ByVal grfFlags As Long) As Long
    Private Declare Function GetClientRect Lib "user32" (ByVal hWnd As Long, lpRect As RECT) As Long
    Private Declare Function SetCapture Lib "user32" (ByVal hWnd As Long) As Long
    Private Declare Function ReleaseCapture Lib "user32" () As LongPrivate Const BF_TOP = &H2
    Private Const BF_LEFT = &H1
    Private Const BF_RIGHT = &H4
    Private Const BF_BOTTOM = &H8
    Private Const BF_RECT = (BF_LEFT Or BF_TOP Or BF_RIGHT Or BF_BOTTOM)Private Const BDR_RAISEDINNER = &H4
    Private Const BDR_SUNKENOUTER = &H2Private Type RECT
            Left As Long
            Top As Long
            Right As Long
            Bottom As Long
    End TypePrivate rc As RECTPrivate Sub Form_Load()
        Picture1.AutoRedraw = True
    End SubPrivate Sub Picture1_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
        GetClientRect Picture1.hWnd, rc
        If x > 0 And x < Picture1.ScaleWidth And y > 0 And y < Picture1.ScaleHeight Then
            DrawEdge Picture1.hdc, rc, BDR_RAISEDINNER, BF_RECT
            Picture1.Refresh
            SetCapture Picture1.hWnd
        Else
            Picture1.Cls
            ReleaseCapture
        End If
    End SubPrivate Sub Picture1_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
        DrawEdge Picture1.hdc, rc, BDR_SUNKENOUTER, BF_RECT
        Picture1.Refresh
    End SubPrivate Sub Picture1_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)
        DrawEdge Picture1.hdc, rc, BDR_RAISEDINNER, BF_RECT
        Picture1.Refresh
    End Sub
      

  2.   

    SetCapture的缺点:ToolTip会消失
      

  3.   

    如果是标签或是命令按钮而不是pictrue该怎么办
      

  4.   

    没有hWnd也没关系,用最笨的办法