前言:
CPPToolTip的使用方法与系统的CToolTipCtrl控件的方法大同小异,大致如下:
1、定义变量 : CPPToolTip m_tooltip;
2、重载 PreTranslateMessage : m_tooltip.RelayEvent(pMsg);
3、使用:
m_tooltip.Create( this );
m_tooltip.AddTool(GetDlgItem(IDC_BUTTON1), _T(
"Tooltip to the control IDC_BUTTON1"));
//矩形区域
m_tooltip.AddTool( this, _T( "Tooltip for rectangle area" ),CRect(0,0,100,100) );
m_tooltip.SetColorBk(RGB(0, 255, 0)); //tip提示颜色
问题描述:
在单文档程序正常,但是对话框程序中按钮的 tip 正常,但是矩形区域的 tip 无法正常显示。
跟踪源代码到如下位置:
对于当前窗口是父窗口(也就是没有父窗口的)会直接返回,所以此处去掉限制即可。