Click here to Skip to main content
15,947,411 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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.

C++
// 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);
}


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.
Posted
Updated 8-Apr-12 17:06pm
v2

1 solution

Ok, I've solved it.

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

link[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900