如果设置了CBRS_TOOLTIPS风格位,工具条将显示工具提示,要使能或者禁止
工具提示,需要设置或者清除该风格位。下例通过调用
CControlBar : : GetBarStyle和CControlBar : : SetBarStyle建立一个完成
此功能的成员函数:
void CMainFrame : : EnableToolTips ( BOOL bDisplayTips )
{
 ASSERT_VALID (m_wndToolBar) DWORD dwStyle = m _wndToolBar.GetBarStyle ( ) if (bDisplayTips) dwStyle |=CBRS_TOOLTIPS else
 dwStyle & = ~CBRS_TOOLTIPS m_wndToolBar.SetBarStyle (dwStyle )
}

解决方案 »

  1.   

    to:luckyegg(幸运蛋) (
    你说的那个风格我已经加了,可是我怎么才能让他有TIP 显示呢! 多谢了!
      

  2.   

    每个按钮不都有属性吗,里面有个Prompt,输入\n,然后之后的东西就都是提示了。
    For example,\n打开文件
      

  3.   

    to:ghz(浪子)
    这个按钮是我 自己Create的! 我应该怎么办呢!
      

  4.   

    CToolBar    m_wndToolBar;
    ………
    m_wndToolBar.SetButtonInfo(0,ID_BUTTONNEW,TBSTYLE_BUTTON,0);
    m_wndToolBar.SetButtonText(0,"添加");
    //我的ID_BUTTONEDIT在StringTable里定义为           "\n编辑当前记录"
      

  5.   

    //填加控制工具条的按钮提示,在oncreate中
    m_ToolTipWndControl.Create(this,TTS_ALWAYSTIP); rect.left=0;
    rect.top=0;
    rect.right=38;
    rect.bottom=42;
    for (i=IDS_TOOLBAR_LOGON;i<=IDS_TOOLBAR_EXIT;i++)
    {
    BOOL bIsSuccess=strTip.LoadString(i);
    bIsSuccess=m_ToolTipWndControl.AddTool(&m_wndControlBar,(LPCSTR)strTip,(LPRECT)rect,i);
    rect.left=rect.right;
    rect.right+=42;
    }
    m_ToolTipWndControl.Activate(TRUE);