可以实现的方法是继承CBITMAPBUTTON类,建立TIP控件并实现,应该很简单
class CMyButton : public CBitmapButton
{
...
CToolTipCtrl tip;
}
void CMyButton::SetBtnTip(LPCTSTR lpszTip)
{
tip.AddTool(this, lpszTip);
}
BOOL CMyButton::PreTranslateMessage(MSG* pMsg)
{
// TODO: Add your specialized code here and/or call the base class
tip.RelayEvent(pMsg);
}你可以把分都给我了!!!!!!
class CMyButton : public CBitmapButton
{
...
CToolTipCtrl tip;
}
void CMyButton::SetBtnTip(LPCTSTR lpszTip)
{
tip.AddTool(this, lpszTip);
}
BOOL CMyButton::PreTranslateMessage(MSG* pMsg)
{
// TODO: Add your specialized code here and/or call the base class
tip.RelayEvent(pMsg);
}你可以把分都给我了!!!!!!
在OnInitDialog中加入
m_tipCtrl.Create(this);
m_tipCtrl.Active(TRUE);
m_tipCtrl.AddTool(GetDlgItem(位图按钮的ID号,"位图按钮的tip信息");在CDialog::PreTranslateMessage(MSG *pMsg)中
加入m_tipCtrl.RelayEvent(pMsg);