I’m writing a custom TreeView from ScrollableControl. I decided to show tooltips when the mouse hovers over nodes with text too long to display.
I find that when tooltips are shown, the user is not able to click the node to select it because (I think) he’s clicking the tooltip window, not my control.
Is there any easy solutions? As far I can see, System.Windows.Forms.TreeView don’t have this problem. Thanks!
You need to override
WndProcin your tooltip form and returnHT_TRANSPARENTin response to theWM_NCHITTESTmessage.For example:
This will make Windows believe that your from is invisible to the mouse, causing any mouse events to be passed to the window underneath it. (But only if both windows are from the same process)