当鼠标移动到CListCtrl的某一行时,提示一些信息。
具体实现方法:
1、头文件定义
CToolTipCtrl m_tooltip;
2、在OnInitDialog()中进行初始化
EnableToolTips(TRUE);
m_tooltip.Create(this);
m_tooltip.SetMaxTipWidth(500);
m_tooltip.Activate(TRUE);
LONG lStyle;
lStyle = GetWindowLong(m_listCourse.m_hWnd, GWL_STYLE);//获取当前窗口style
lStyle &= ~LVS_TYPEMASK; //清除显示方式位
lStyle |= LVS_REPORT; //设置style
SetWindowLong(m_listCourse.m_hWnd, GWL_STYLE, lStyle);//设置style
DWORD dwStyle = m_listCourse.GetExtendedStyle();
dwStyle |= LVS_EX_FULLROWSELECT;//选中某行使整行高亮(只适用与report风格的listctrl)
dwStyle |= LVS_EX_GRIDLINES;//网格线(只适用与report风格的listctrl)
dwStyle |= LVS_EX_CHECKBOXES;//item前生成checkbox控件
m_listCourse.SetExtendedStyle(dwStyle); //设置扩展风格
CRect rectangle;
m_listCourse.GetWind