会触发包含这个控件的的对象的MouseMove!

解决方案 »

  1.   

    '我一般这样实现
    Option Explicit
    Private Sub Command1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    Command1.FontBold = True
    End Sub
    Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    Command1.FontBold = False
    End Sub
      

  2.   

    VB本身不带这样的事件.
    不过可以用SetCapture和ReleaseCapture 两个API配合三个mouse事件得以实现.
    具体方法可写信联系Email:[email protected]
      

  3.   

    mouxemove事件中
    if x>=0 and x<=command1.width amd y>=0 and y<=command1.height then
    command1.font.size=12
    command1.font.bold=true
    setcapture command1.hwnd
    else
    command1.font.size=9
    command1.font.bold=false
    releasecapture
    endif
      

  4.   

    用控件容器上的MouseMove事件....
    如果要判断是在某一个控件上移出的,加一个变量确定就是了。
      

  5.   

    Private Declare Function SetCapture Lib "user32" (ByVal hWnd As Long) As Long
    Private Declare Function ReleaseCapture Lib "user32" () As LongPublic Function MouseOver(ByVal Controler As Control, _
                            ByVal Button As Integer, _
                            ByVal X As Single, _
                            ByVal Y As Single) As Boolean
                            
    '判断鼠标是否进入控件上
    '请在MouseMove事件中使用此函数With Controler
        If Button = 0 Then
            If (X < 0) Or (Y < 0) Or (X > .Width) Or (Y > .Height) Then
                ReleaseCapture
                MouseOver = False  '离开控件
            Else
                SetCapture .hWnd
                MouseOver = True   '进入控件
            End If
        End If
    End WithEnd Function
      

  6.   

    可以编一个当鼠标离开某控件时所发生的事件!!
    例如:现在鼠标在COMMAND1控件上,当鼠标指到FORM1上时~~~
          在FORM1_MOUSEMOVE事件上就可编写触发的事件!!!
      

  7.   

    to feihong0233(泓) :
    如何使用?