Toolwindows/TabbedMDIwindows not focused if non-editable

Docking/MDI for Windows Forms Forum

Posted 18 years ago by Chien A.
Avatar
Hi, is there any reason why if you click over any area of a toolwindow that does not contain an editable control eg the 'Welcome to UIStudio' toolwindow in the dock controls demo, why the toolwindow does not become focused/activated? The only way to for it to receive focus is to click the titlebar of its toolwindowcontainter.

Another probably fairly common scenario would be to place a toolstrip within a toolwindow and adding a button to it. Clicking on this button will not bring the toolwindow into focus.

Is there something I am missing or is there a workaround for this? I am basically after the normal window behaviour of focusing the window (or in this case toolwindow) wherever/whatever is clicked on within it.

The only thing I could think of so far is handling click events to manually activate the parent toolwindow, but this might not always be possible.

Comments (1)

Posted 18 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
This unfortunately is a difficult thing to process in Windows Forms. I believe in WPF it is easier to handle. But in Windows Forms what we are doing is handling the Enter event of our tool windows to determine if they receive focus. Some controls such as toolbars might not set focus and therefore never raise that event. And unfortunately Click events on child controls don't bubble up to parent controls.

So you might have to process the Click event on your toolbar and in that case look for a TabbedMdiWindow parent and if found, call Activate on it.


Actipro Software Support

The latest build of this product (v24.1.0) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.