onMouseOver issue

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Sam

    #1

    onMouseOver issue

    Hi,
    I have developped a docking panel that shows when the mouse is over a
    button and then hides when the mouse leaves the panel. It works fine
    except when there are child controls in the panel and that the mouse
    leaves the panel through the child controls. Since the mouse didn't
    leave through the panel directely, the panel is not hide.
    Here is my method onMouseMove for the inherited panel :

    Protected Overrides Sub OnMouseMove(ByV al e As
    System.Windows. Forms.MouseEven tArgs)
    Dim pt As New Point(e.X, e.Y)
    If Not Me.ClientRectan gle.Contains(pt ) And Not m_chkAnchor.Che cked
    Then
    Collapse()
    End If
    End Sub

    On this screenshot you can see my panel with a tree on it, if the mouse
    leaves via the tree, then obviously the panel is not collapsed.


    On this screenshot it works always as there is a margin between the
    tree and the edge of the panel :



    But I want the docking property of my tree to be set to RIGHT.
    Therefore there is no margin. How can I force this margin so that my
    tree collapse properly all the time


    Thank you for your help

Working...