- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi there its me again :)
Does anyone know, if there is a way to set an item of a TreeView to highlited state, if the item was clicked with the right mousebutton?
Finding out, which item was selected, firing a ContextMenu and so on, i already done.
My problem is, that after the routines in the ContextMen are done, the highlightbar jumps back to the item, where it was before.
On left click, the highlight bar stays on the new selected item.
Tried it already with a bit "dirty hacking" and just coded a simulation of the leftclick on the same position where the right click has been done. The left click event is fired on the treeview and its acting like it should, but the highlight bar also going back to the item where it was before then.
Any suggestions?
Best Regards
Oliver
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I found an answer by myself.
only this SendMessage did work
[fortran]retlog = SendMessage(hwnd_tree, TVM_SELECTITEM , TVGN_DROPHILITE, sel_item_ID)[/fortran]
the problem was, that there have to be a "second eventcircle" (dont know how to describe it better) after i performed the contextmenu and the operations.
circle 1 (hook up rightclick, simulating left click)
circle 2 (collecting item information and do specific code...store selected item id)
circle 3 (above sendmessage)
quite not elegant, but performance is good and works like a charm.
any other suggestions of a more better way are welcomed :)
Best Regards
Oliver
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page