CCheclListBox,ItemFromPoint不准确? [英] CCheclListBox, ItemFromPoint not accurate?

查看:83
本文介绍了CCheclListBox,ItemFromPoint不准确?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我尝试使用"ItemFromPoint"在CCheclListBox中设置工具提示,但它总是告诉我鼠标不在CCheckListBox之外.

Hi,

I''ve tried to set tool tip in my CCheclListBox using "ItemFromPoint", but it is always telling me that my mouse is outside the CCheckListBox.

// In Header File
CToolTipCtrl* m_pGrpToolTip;
CCheckListBox m_listGrpBox;
BOOL m_bOutside;


// In Init Dialog
m_pGrpToolTip = new CToolTipCtrl();
EnableToolTips(TRUE);

//create tool tip object
m_pGrpToolTip->Create(this);
m_pGrpToolTip->AddTool(&m_listGrpBox);
m_pGrpToolTip->Activate(true);


void CEffectDlg::OnMouseMove(UINT nFlags, CPoint point)
{
	SetCapture();
	UINT uCurItem = m_listGrpBox.ItemFromPoint(point, m_bOutside);
	CString test;
	if (!m_bOutside)
	{
		m_listGrpBox.GetText(uCurItem , test);
		m_pGrpToolTip->UpdateTipText(test, &m_listGrpBox);
		ReleaseCapture();
	}

	CDialog::OnMouseMove(nFlags, point);
}



即使我的鼠标位于CCheckListBox内,m_bOutside始终为"1".

我做错什么了吗?
任何帮助是极大的赞赏.谢谢.



m_bOutside is always "1", even though my mouse is inside the CCheckListBox.

Am i doing anything wrong?
Any help is greatly appreciated. Thank you.

推荐答案

好,我已经解决了.

我在另一个论坛上找到了答案.
通过子类化CCheckListBox做到了.

链接 ^ ]
Ok, I''ve solved it.

I found the answer in another forum.
Did it by subclassing the CCheckListBox.

link[^]


这篇关于CCheclListBox,ItemFromPoint不准确?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆