views:

379

answers:

1

I have a TreeView control in a Windows application. I am opening another window from the TreeView click (Single Click) event (in tabbed environment, so all windows will appear as a tab in Visual Studio). I want to set focus to one control of the new window.

The problem is that, I am able to set the focus on the double click event of the TreeView. But same doesn't seem to be working with the TreeView single-click event.

Any workarounds?

A: 

Have you tried doing this in MouseUp instead? If that fails, there's always an easy (but disgusting) solution when it comes to UI issues like this: start a timer (with a running time of 10 ms or so) that will set the focus when it fires.

danbystrom