设置Tooltips

来源:互联网 发布:购买日货软件 编辑:程序博客网 时间:2024/05/16 18:36

  1添加功能代码

CToolTipCtrl* pToolTip = new CToolTipCtrl;
  if(!pToolTip->Create(this))
  {  
   TRACE("Unable   To   create   ToolTip/n");  
   //return   TRUE;  
  }  
  else
  {
   CString strToolTips = "Tooltips";
   pToolTip->AddTool(pWnd/*要添加Tooltip的控件*/,strToolTips); 
   
   pToolTip->Activate(TRUE);
  }

2然后,通过ClassWizard添加虚函数PreTranslateMessage的实现框架,并加入下列代码

 if(m_pToolTip)
 {
  m_pToolTip->RelayEvent(pMsg);
 }

原创粉丝点击