-
April 14th, 2006, 04:45 AM
#1
Tree View Right Click Problem.
Having problems about right clicking on an item in a tree control. The item
that is clicked on is not the right one.
If I have three items in a tree.
Here is my problem. I click on the first item with normal click. I click on
the third item with the right click mouse. In this event I had a messagebox
telling me which item is selected, and this one comes out with the first
item no mather what. I also tried to get into the OnSelchangedItemfieldtree
function - but with no luck.
How can I right click on the third one and get its name out of it? Does
anyone know?
Last edited by harshandu; April 14th, 2006 at 05:20 AM.
-
April 14th, 2006, 05:33 AM
#2
Re: Tree View Right Click Problem.
hmm... are you using GetSelectedItem()?
You just divided by zero, didn't you?
-
April 14th, 2006, 05:48 AM
#3
Re: Tree View Right Click Problem.
-
April 14th, 2006, 01:22 PM
#4
Re: Tree View Right Click Problem.
Take a look at this thread
-
April 14th, 2006, 11:11 PM
#5
Re: Tree View Right Click Problem.
Hello all,
Thanks a lot.I solved by using following code.
BOOL CAddASDU::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult)
{
// TODO: Add your specialized code here and/or call the base class
if(wParam == IDC_POINTS)
{
NMTREEVIEW* pNMTV = (NMTREEVIEW *) lParam;
if(pNMTV->hdr.code == NM_RCLICK)
{
HTREEITEM hItem = m_PointsTree.GetDropHilightItem();
if(hItem) m_PointsTree.SelectItem(hItem);
}
}
return CDialog::OnNotify(wParam, lParam, pResult);
}
-
April 14th, 2006, 11:21 PM
#6
Re: Tree View Right Click Problem.
Just use CTreeCtrl::GetSelectedItem when handling the NM_RCLICK
It takes seconds for rating…that actually compensates the minutes taken for giving answers
The biggest guru-mantra is: Never share your secrets with anybody. It will destroy you.
Regards, Be generous->Rate people
Jayender!!
-
April 15th, 2006, 12:37 AM
#7
Re: Tree View Right Click Problem.
Ya jayender thats required but it isnt alone solve the problem.we need to override the onnotify function as said above.
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
|