Board index » Visual Studio » dialog tooltips

dialog tooltips

Visual Studio164
Hi,

I'm trying to have tooltips in my dialog.

I did the following:

1. added EnableToolTips(true) in the OnInitDialog().

2. Added ON_NOTIFY_EX(TTN_NEEDTEXT, 0, OnToolTipNeedText) in the dialog's

message map.

3. addded the function OnToolTipNeedText in the dialog's class and set there

a breakpoint



The problem was that I never reached the breakpoint.

Did I forget something?

Ram.


-
 

Re:dialog tooltips

Read the help page for EnableToolTips. Pay attention to the message maps

entries they have in the sample code.



Ali R.



"Ram Baruch" <info@metalix-cad-cam.com>wrote in message

Quote
Hi,

I'm trying to have tooltips in my dialog.

I did the following:

1. added EnableToolTips(true) in the OnInitDialog().

2. Added ON_NOTIFY_EX(TTN_NEEDTEXT, 0, OnToolTipNeedText) in the dialog's

message map.

3. addded the function OnToolTipNeedText in the dialog's class and set

there

a breakpoint



The problem was that I never reached the breakpoint.

Did I forget something?

Ram.









-

Re:dialog tooltips

Hi Ram,



Thanks for posting in group!



Based on Ali's recommended MSDN documentation, I think you can easily get

ToolTips appeared on your dialog's control:



http://msdn.microsoft.com/library/default.asp?url" rel="nofollow" target="_blank">msdn.microsoft.com/library/default.asp=/library/en-us/vclib/html/

_MFC_CWnd.3a3a.EnableToolTips.asp





BTW, I also found 2 related sample projects in the www.codeproject.com:

http://www.codeproject.com/docking/tooltipsindialog.asp?target" rel="nofollow" target="_blank">www.codeproject.com/docking/tooltipsindialog.asp=tooltips

http://www.codeproject.com/dialog/tooltips.asp?target" rel="nofollow" target="_blank">www.codeproject.com/dialog/tooltips.asp=tooltips



Hope it helps!





Best regards,

Gary Chang

Microsoft Online Partner Support



Get Secure! - www.microsoft.com/security

This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------



Third-Party Link Disclaimer



This response contains a reference to a third-party World Wide Web site.

Microsoft is providing this information as a convenience to you. Microsoft

does not control these sites and has not tested any software or information

found on these sites; therefore, Microsoft cannot make any representations

regarding the quality, safety, or suitability of any software or

information found there. There are inherent dangers in the use of any

software found on the Internet, and Microsoft cautions you to make sure

that you completely understand the risk before retrieving any software from

the Internet.





-

Re:dialog tooltips

Hi,

Eventually, I was able to show tooltips in my dialog. I used

http://support.microsoft.com/default.aspx?scid" rel="nofollow" target="_blank">support.microsoft.com/default.aspx=kb;en-us;135873&Product=vcc



and it worked.

The problem now is that I cannot display multilines in my tooltips.

I read and found that if I add '\r\n':

rt = m_pTooltip->AddTool(this, "first line\r\nseond line");



But it didn't have any effect - the string was displayed in one line.

I tried to find something that sets the tooltip to multiline but I didn't

find.

Do you have any idea?

Ram.



"Gary Chang [MSFT]" <v-garych@online.microsoft.com>wrote in message

Quote
Hi Ram,



Thanks for posting in group!



Based on Ali's recommended MSDN documentation, I think you can easily get

ToolTips appeared on your dialog's control:





http://msdn.microsoft.com/library/default.asp?url" rel="nofollow" target="_blank">msdn.microsoft.com/library/default.asp=/library/en-us/vclib/html/

_MFC_CWnd.3a3a.EnableToolTips.asp





BTW, I also found 2 related sample projects in the www.codeproject.com:

http://www.codeproject.com/docking/tooltipsindialog.asp?target" rel="nofollow" target="_blank">www.codeproject.com/docking/tooltipsindialog.asp=tooltips

http://www.codeproject.com/dialog/tooltips.asp?target" rel="nofollow" target="_blank">www.codeproject.com/dialog/tooltips.asp=tooltips



Hope it helps!





Best regards,

Gary Chang

Microsoft Online Partner Support



Get Secure! - www.microsoft.com/security

This posting is provided "AS IS" with no warranties, and confers no

rights.

--------------------



Third-Party Link Disclaimer



This response contains a reference to a third-party World Wide Web site.

Microsoft is providing this information as a convenience to you. Microsoft

does not control these sites and has not tested any software or

information

found on these sites; therefore, Microsoft cannot make any representations

regarding the quality, safety, or suitability of any software or

information found there. There are inherent dangers in the use of any

software found on the Internet, and Microsoft cautions you to make sure

that you completely understand the risk before retrieving any software

from

the Internet.









-

Re:dialog tooltips

Hi Ram,



Thanks for you quickly response!



For multiline tooltips, you can refer to the following link:

http://www.codeproject.com/miscctrl/tooltipex.asp?target" rel="nofollow" target="_blank">www.codeproject.com/miscctrl/tooltipex.asp=%22multiline+toolti

ps%22



Best regards,

Gary Chang

Microsoft Online Partner Support



Get Secure! - www.microsoft.com/security

This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------



Third-Party Link Disclaimer



This response contains a reference to a third-party World Wide Web site.

Microsoft is providing this information as a convenience to you. Microsoft

does not control these sites and has not tested any software or information

found on these sites; therefore, Microsoft cannot make any representations

regarding the quality, safety, or suitability of any software or

information found there. There are inherent dangers in the use of any

software found on the Internet, and Microsoft cautions you to make sure

that you completely understand the risk before retrieving any software from

the Internet.







-

Re:dialog tooltips

Hi Ram,



You also can try the TTM_SETMAXTIPWIDTH message to force the tooltip

control to display multiple lines.

http://msdn.microsoft.com/library/default.asp?url" rel="nofollow" target="_blank">msdn.microsoft.com/library/default.asp=/library/en-us/shellcc/pla

tform/commctls/tooltip/messages/ttm_setmaxtipwidth.asp



Best regards!



Gary Chang

Microsoft Online Partner Support



Get Secure! ? www.microsoft.com/security

This posting is provided "AS IS" with no warranties,and confers no rights.

--------------------



-