10-19-2007 05:27 AM
10-19-2007 10:40 AM
You have a couple of options.
1) You can use a tree control and configure it to look just like a listbox. This way has some advantages:
- the tree behaves just like you want on a right click... it changes the active item on a right click, then pops up the context menu.
- it has it's own customizable right click context menu, so you don't have to use RunPopupMenu
- other additional functionality such as tooltips, horizontal scrollbar, etc. Check out http://forums.ni.com/ni/board/message?board.id=180&message.id=13541#M13541
2) Use GetIndexFromPoint in the right click event to get which listbox item was clicked on, make it the active one, then call RunPopupMenu.
Hope this helps
- jared
10-22-2007 04:08 AM
04-21-2021 12:30 PM
Hi Martin,
Were you able to implement the code to rename or delete the list box items using a custom right-click menu?
04-24-2021 01:29 AM - edited 04-24-2021 01:38 AM
You are not expected to get an answer from Martin, who has not been visiting this site for 11 years!
Nevertheless GetIndexFromPoint is supposed to be the right path to go: have you tried implementig it? We can try helping you if you can post your code pointing out where you are getting problems.
04-26-2021 08:33 AM
Thanks for replying Roberto. So I was able to get it implemented using the other example shared on the forum.
Regards,