-
Tooltip in TreeCtrl
Say there is a TreeCtrl that has many nodes, and would like to display different tooltip for each node in the same control. Is that possible?
Check the Tooltip in MSDN, it seems only one tip for one control.
How about one tip for one node in a control?
-
Re: Tooltip in TreeCtrl
You can setup a different tooltip for different rects using the CToolTip
BOOL AddTool(
CWnd* pWnd,
LPCTSTR lpszText = LPSTR_TEXTCALLBACK,
LPCRECT lpRectTool = NULL,
UINT_PTR nIDTool = 0
);
lpRectTool can be the rect of the item which you can retrieve using GetItemRect, and nIDTool can be an index. ( make sure index is different for each item and !=0 ). The easiest way is whenever an item is added to your treectrl you use AddTool to add a tooltip to it.
-
Re: Tooltip in TreeCtrl
It is not necessary to use to use CToolTip. Setting tool dor each node, can end up with considerable number of AddTool calls.
There is much simpler way of handling it. See my article it may help you.
-
Re: Tooltip in TreeCtrl
Thanks guys. You both offer very pratical solution to me.
(Y)