我的程序是个对话框,中间有个listctrl, 我在这个listctrl中的某个subitem中添加了个button,每个列表项的那个子项都有一个button,每给列表添加一个项目,就会多个button,删除一个列表项,对应的button也会删除,这些button都同一个nID=1900.自定义的.现在我想给这个动态的button添加tooltip,传统的方法添加,没成功.我的做法是:重载button类的create函数
BOOL CListButton::Create(LPCTSTR lpszCaption, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID)
{
m_tip.Create(this);
m_tip.AddTool(this,_T("aaaa"));
return CButton::Create(lpszCaption, dwStyle, rect, pParentWnd, nID);
}重载button类的pretranslatemessage函数
BOOL CListButton::PreTranslateMessage(MSG* pMsg)
{
m_tip.RelayEvent(pMsg);
return CButton::PreTranslateMessage(pMsg);
}但就是没起作用,哪位高手告诉我为什么tooltip不起作用,应该如何做才能给这种列表中的子按钮添加tooltip
BOOL CListButton::Create(LPCTSTR lpszCaption, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID)
{
m_tip.Create(this);
m_tip.AddTool(this,_T("aaaa"));
return CButton::Create(lpszCaption, dwStyle, rect, pParentWnd, nID);
}重载button类的pretranslatemessage函数
BOOL CListButton::PreTranslateMessage(MSG* pMsg)
{
m_tip.RelayEvent(pMsg);
return CButton::PreTranslateMessage(pMsg);
}但就是没起作用,哪位高手告诉我为什么tooltip不起作用,应该如何做才能给这种列表中的子按钮添加tooltip
http://hi.baidu.com/fateyeah/blog/item/fc7c07b37ab250a7d9335aa7.html
里面说得很清楚