|
-
August 30th, 1999, 03:36 AM
#1
CListCtrl
Hi,
I am trying to do the following: If the user clicks anywhere on a CListCtrl (doesn't have to be the first column), the matching item should be selected. For this action, I am using code I found on codeguru's control section.
Why isn't it working?
void CPreislisteDlg::OnLButtonDown(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
CDialog::OnLButtonDown(nFlags, point);
int index;
point.x = 2;
if((index = m_cPreisListe.HitTest(point, NULL)) != -1)
{
MessageBox("OK");
m_cPreisListe.SetItemState(index, LVIS_SELECTED | LVIS_FOCUSED, LVIS_SELECTED | LVIS_FOCUSED);
}
}
Thanks!
Fox20
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|