Sign in to follow this  
Niksan2

[.net] TreeView and Scrollbars [Solved]

Recommended Posts

Niksan2    265
Hello, Does anyone know if it's possible to get any indication when a scrollbar has been clicked on a treeview ? The reason I ask is that I use a TextBox sat on the treeview used for multi-column editing, but when you click on the scrollbars of a TreeView the control doesn't gain focus so am unable to losefocus/hide the TextBox, I know I can do this by subclassing the TreeView and overriding WndProc look for scroll messages, but I guess this may only work when actually scrolling and not just by clicking on it, which shouldn't be an issue, but I just wondered if there was another way as currently I'm using the designer to create a user control with a treeview attached to emulate VisualStudios watch window, all works apart from this little niggle. Cheers, Nik. [Edited by - Niksan2 on February 28, 2008 5:57:35 AM]

Share this post


Link to post
Share on other sites
Niksan2    265
Ok, I'll answer my own question as the old post/solve shinanigans hits home again :) and if it helps anyone else, I displayed all messages (WndProc) for the actual root user control and it was getting a few messages passed through when clicking on the scrollbar, parentnotify, mouseactivate, and a couple of notify/setcursor one for a mouse up and mouse down event, so I checked if the control wasn't in focus and the parentnotify was received to then set the control to focus, seems to work, but I'm sure there will be some pitfalls at some point, maybe.

Cheers,

Nik.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this