-
August 21st, 2008, 02:18 AM
#1
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?
-
August 21st, 2008, 03:33 AM
#2
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.
-
August 29th, 2008, 07:55 PM
#3
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.
There are only 10 types of people in the world:
Those who understand binary and those who do not.
-
August 31st, 2008, 10:31 PM
#4
Re: Tooltip in TreeCtrl
Thanks guys. You both offer very pratical solution to me.
(Y)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|