在Visual Studio 2010下遇到“MFC的CListBox控件使用LBS_OWNERDRAWVARIABLE风格不能AddString的问题”
后重载MeasureItem函数(注意不是OnMeasureItem函数),AddString就通过了!
Q:控件的使用者收不到OnLbnSelchangeXX事件
控件风格中添加BS_NOTIFY属性
Q 鼠标下的entry高亮
重载CListBox继承类的OnMouseMove方法
{
BOOL bOutSide = FALSE;
int nIndex = ItemFromPoint(point,bOutSide);
if(nIndex<0)
return;
if(nIndex==GetCurSel())
return;
SetCurSel(nIndex);
CListBox::OnMouseMove(nFlags,point);
}