我给一个CDialog添加工具提示后显示不了提示,代码如下: CToolTipCtrl * m_tooltip;
m_tooltip = new CToolTipCtrl;
m_tooltip->Create(this);
m_tooltip->AddTool(GetDlgItem(IDC_BUTTON1),"确定");
m_tooltip->Activate(TRUE);请问一下各位,到底是怎么回事?
m_tooltip = new CToolTipCtrl;
m_tooltip->Create(this);
m_tooltip->AddTool(GetDlgItem(IDC_BUTTON1),"确定");
m_tooltip->Activate(TRUE);请问一下各位,到底是怎么回事?
Specifies the tool tip control’s parent window, usually a CDialog. It must not be NULL.由MSDN的描述可知,你的Create函数,第一个参数应当是NULL。
m_tip=new CToolTipCtrl;
m_tip->Create(this);
m_tip->AddTool(&m_Restart,_T("计算机"));
//激活工具提示
m_tip->Activate(TRUE);
//重载函数,处理tip
if (NULL != m_tip)
{
m_tip->RelayEvent(pMsg);
}return CDialog::PreTranslateMessage(pMsg);
m_tip=new CToolTipCtrl;
m_tip->Create(this);
m_tip->AddTool(&m_Restart,_T("计算机"));
//激活工具提示
m_tip->Activate(TRUE);以上是在初始化中做的