Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1745
Need tooltip only if over TreeNode text
posted

In many cases my TreeNodes have additional text associated with them.
I want to display this in a tooltip when the mouse is over the text part of the node only.

I have used MouseEnterElement() to [almost] determine whether I am over the text rather than the icon by checking the width of the UIElement.
(if the width is 16 then it must be the icon)

However I have 2 problems.

1. There is a 1 pixel area above/below each icon that is not caught by this test. so if I move between icons the text briefly flashes.
    Is there a better way to determine that I am specifically over the Text element?

2. The automatic tooltips that you display when the text is not fully visible only display when the mouse is over the text - not the icon.
    Since I am displaying my own text in that situation I want to display the automatic text when the mouse is over the icon.
    (Either by changing a property to automatically display it when over the icon instead/in adition to over the text, or by detecting that the text is not fully displayed [while I am over the icon] and displaying the full text in my own tooltip.)

Thanks ... Mike    

Parents
  • 9298
    posted

    Mike,

    Rather than checking for the width of the UIElement, I think you could check that the Type of the UIelement is TextUIElement.  That should be more reliable than testing for the length of the UIElement.  I will have to think about your second question. 

Reply Children