// CG: The following block was added by the ToolTips component. { // Create the ToolTip control. m_tooltip.Create(this); m_tooltip.Activate(TRUE); // TODO: Use one of the following forms to add controls: m_tooltip.AddTool(GetDlgItem(IDOK), "<text>"); }
m_btnhelpapp.SubclassDlgItem(IDC_BUTTONHELP1,this);
m_btnhelpapp.SetTooltipText("帮助");
其中,m_btnhelpapp为CButtonST对象,IDC_BUTTONHELP1为button ID.
找个例子看看就知道了,很简单的
{
// Create the ToolTip control.
m_tooltip.Create(this);
m_tooltip.Activate(TRUE); // TODO: Use one of the following forms to add controls:
m_tooltip.AddTool(GetDlgItem(IDOK), "<text>");
}
重载PreTranslateMessage消息——在调用基类的PreTranslateMessage之前
添加m_tooltip.relayMessage(msg);呵呵!
动态产生的一个基类是CFORMVIEW的对话框,在插入TOOLTIP时让我选择插入类里只有派生于
CDIALOG的.我该怎办才能插入到基类是CFORMVIEW的对话框里啊