Re: Win32Lib - Updating Interface with Click on TV
- Posted by DerekParnell (admin) Apr 13, 2010
- 1324 views
When clicking on the TreeView in the following program, the label text should be updated with the currently selected TV item. However, it always lags behind one. I'm sure I'm doing something stupid... but what? :/
No, your code is good. I know the problem but haven't got a good solution yet.
The problem is that Microsoft has made different rules for treeviews and it regards a click to occur on a mousedown event for a TV item, but it only changes the selection after the mouseup event. So your code is getting the text from the item that was selected at the time the mousedown happened, but then after you display the text, Microsoft changes the selection to the item that the mouse(up) event occured on.
I'm trying different ideas to get around this stupidity, but haven't got the ideal solution yet.