我想实现鼠标移到ListCtrl报表中某一行,弹出tips窗口,显示信息,我在网上找的代码,实现后,发现个问题,就是AddTool的第三个参数是相对父窗口的坐标,而我的列表框内容比较多,所以当列表框滚到下一屏时,当前第一行(实际是列表框的第21行)的tips信息还是第一行的,这怎么解决啊?新手求救!
CRect rect;
m_List.GetItemRect(0, &rect, LVIR_BOUNDS);
m_Mytip.AddTool(&m_List, des1);
m_List.GetItemRect(1, &rect, LVIR_BOUNDS);
m_Mytip.AddTool(&m_List, des2, &rect, 2);
m_List.GetItemRect(2, &rect, LVIR_BOUNDS);
m_Mytip.AddTool(&m_List, des3, &rect, 3);
……
CToolTipCtrl,MFC
CRect rect;
m_List.GetItemRect(0, &rect, LVIR_BOUNDS);
m_Mytip.AddTool(&m_List, des1);
m_List.GetItemRect(1, &rect, LVIR_BOUNDS);
m_Mytip.AddTool(&m_List, des2, &rect, 2);
m_List.GetItemRect(2, &rect, LVIR_BOUNDS);
m_Mytip.AddTool(&m_List, des3, &rect, 3);
……
CToolTipCtrl,MFC
解决方案 »
- CListCtrl 排序问题
- CString类的两个字符串忽略字符后面的空格进行比较
- error C2109: subscript requires array or pointer type是何问题?
- 怎么样制作一个ActiveX的安装文件----------------------------不是小气,我已经没有分了
- 对话框能否用菜单?怎么实现?
- 这样的ListView如何实现,急!!!!!!
- 图形编辑软件中,无限次“撤销”、“重做”的实现方法
- MFC的奇怪问题求解!高分!!!
- 这里有好几个问题,但都是大家值得一看的
- 一个MFC的问题
- 多台计算机同时向一个计算机发送多个文件 网络 多线程
- VC6集成purify,启动进程出错问题求助.散尽60分.
lpszText
Pointer to the text for the tool. If this parameter contains the value LPSTR_TEXTCALLBACK, TTN_NEEDTEXT notification messages go to the parent of the window that pWnd points to.
使用:
LPSTR_TEXTCALLBACK
然后 在 TTN_NEEDTEXT 中 改 tip
您好,能再说具体下吗?
我不知道如何在TTN_NEEDTEXT 中改tip,怎么能根据CListCtrl的不同行显示不同内容呢?