Hovering over node image

2 posts, 0 answers
  1. Chris Kirkman
    Chris Kirkman avatar
    37 posts
    Member since:
    Jul 2012

    Posted 26 Sep 2012 Link to this post

    I can use the "NodeMouseHover" event to know whether or not I am physically hovering over the node, but how can I tell if I'm over the image which is displayed with the node?

    Seems simple enough, but not so far.
  2. Stefan
    Admin
    Stefan avatar
    2890 posts

    Posted 29 Sep 2012 Link to this post

    Hello Chris,

    Thank you for writing.

    You can use the MouseMove event of RadTreeView to determine over which element is the mouse, since this event provides the current mouse position. Here is an example:
    void radTreeView1_MouseMove(object sender, MouseEventArgs e)
    {
        TreeNodeImageElement imageElement = radTreeView1.ElementTree.GetElementAtPoint(e.Location) as TreeNodeImageElement;
        if (imageElement != null)
        {
           //you are over image element
        }
    }

    I hope this helps.
     
    Regards,
    Stefan
    the Telerik team
    RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
  3. UI for WinForms is Visual Studio 2017 Ready
Back to Top