ComponentOne Menus and Toolbars for WinForms
C1.Win.C1Command.4.5.2 Assembly / C1.Win.C1Command Namespace / C1TopicBar Class / HitTest Method / HitTest(Point) Method
System.Drawing.Point in client coordinates.
Example

In This Topic
    HitTest(Point) Method
    In This Topic
    Returns information about the control at a specified point on the control surface.
    Syntax
    'Declaration
     
    Public Overloads Function HitTest( _
       ByVal p As System.Drawing.Point _
    ) As C1TopicBarHitTestInfo
    public C1TopicBarHitTestInfo HitTest( 
       System.Drawing.Point p
    )

    Parameters

    p
    System.Drawing.Point in client coordinates.

    Return Value

    A C1TopicBarHitTestInfo object that contains information about the point.
    Remarks
    This method is useful when handling the System.Windows.Forms.Control.MouseMove, System.Windows.Forms.Control.MouseDown events or similar. It allows you to determine whether the mouse is over a specific link, page title, etc.
    Example
    The code below shows hit test information whenever the user moves the mouse:
    Private Sub C1TopicBar1_MouseMove(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles C1TopicBar1.MouseMove
    Dim ht As C1.Win.C1Command.C1TopicBarHitTestInfo = C1TopicBar1.HitTest(e.Location)
    Label1.Text = ht.Type.ToString()
    If (Not IsNothing(ht.Page)) Then
       Label2.Text = ht.Page.Text
    Else
       Label2.Text = ""
    End If
    If (Not IsNothing(ht.Link)) Then
       Label3.Text = ht.Link.Text
    Else
       Label3.Text = ""
    End If
    End Sub
    Requirements

    Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

    See Also