我在 对话框中,用 ctoolitipctrl 显示button控件的提示信息
但是,当button灰掉时,tip出不来,
请教高人解决!!!

解决方案 »

  1.   

    可能式PreTranslateMessage不调用了
    看看BSTButton
      

  2.   

    我看了好几天BSTButton了,也看得不是很懂
      

  3.   

    m_tip是类变量 CToolTipCtrl类型
    void CMyFormView::OnInitialUpdate() 
    {
    EnableToolTips(TRUE); 
    m_tip.Create(this, TTS_ALWAYSTIP);
    // m_tip.Activate(TRUE); m_tip.AddTool( &m_btnStart, "开始/继续测试" ); m_tip.AddTool( &m_btnPause, "暂停刷新" ); m_tip.AddTool( &m_btnStop, "停止测试" ); m_tip.AddTool( &m_btnClear, "测试数据清零" ); m_tip.Activate(TRUE);
    }
    当一个按钮灰掉时,鼠标在该按钮上移动时,不出现 tip,其他按钮正常出现提示信息
      

  4.   

    BOOL CPropDlg::PreTranslateMessage(MSG* pMsg) 
    {
    // TODO: Add your specialized code here and/or call the base class MSG msg = *pMsg;
    msg.hwnd = (HWND)tip.SendMessage(TTM_WINDOWFROMPOINT, 0, (LPARAM)&msg.pt);
    CPoint pt = pMsg->pt;
    if (msg.message >= WM_MOUSEFIRST && msg.message <= WM_MOUSELAST)
    ::ScreenToClient(msg.hwnd, &pt);
    msg.lParam = MAKELONG(pt.x, pt.y);

    tip.RelayEvent(&msg);

    return CDialog::PreTranslateMessage(pMsg);
    }
      

  5.   

    http://www.codeguru.com/controls/index.shtm
      

  6.   

    谢谢 cleverwyq(此人三无) 的方法
    问题已解决