|
-
August 24th, 1999, 05:07 AM
#1
CListCtrl DblClk on item
Hi,
if an item was double clicked, how do I get to know which one was it?
TIA,
Fox20
-
August 24th, 1999, 05:31 AM
#2
Re: CListCtrl DblClk on item
Try HitTest function:
void CTree::OnLButtonDblClk(UINT nFlags, CPoint point)
{
HTREEITEM hi = HitTest( point, &nFlags);
}
Let me know if this help u
Regards,
Ovidiu
-
August 24th, 1999, 05:34 AM
#3
Re: CListCtrl DblClk on item
hi,
You can do it handling WM_LBUTTONDBLCLK window
message. There is message handler:
void CCListViewTestView::OnLButtonDblClk(UINT nFlags, CPoint point)
{
LVHITTESTINFO lvItemInfo;
lvItemInfo.pt = point;
if(-1 != GetListCtrl().SubItemHitTest(&lvItemInfo))
{
CString str = GetListCtrl().GetItemText(lvItemInfo.iItem, lvItemInfo.iSubItem);
AfxMessageBox(str);
}
CListView::OnLButtonDblClk(nFlags, point);
}
SubItemHitTest saves info to lvItemInfo about current item.
Hope this will help
================
Marius Bakelis
Software Developer
Matrix Software Baltic
www.matrix-software.nl
=================
Regards,
Marius Bakelis
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
|