Clicking Toolwindow Title Bar does not trigger events

Docking/MDI for WPF Forum

Posted 14 years ago by Bret Naughton
Version: 10.2.0531

Using 5.3.1, I have created a new application where I am programatically creating toolwindows and displaying in an inner-fill screen format. I am setting the content of each toolwindow to an interop/active X. What I am finding is that I am unable to trigger the "WindowActivatedEvent" event when I click on the actual toolwindow title. It is fine if I click into the content of the toolwindow, i.e. the activex component.

I have also tried triggering the 'OnPreviewGotKeyboardFocus' event and displaying the source of when I click a screen object. Again, clicking on the toolwindow title is ignored.

One thing I have done is to try the application on a reinstalled studio 5.2.2., and the selection/event triggering works OK.

I have looked in the forum, and have seen that users did have issues a year or so ago concerning use of interops and triggering of events.... wondered if this is something you may have a possible solution for concerning 5.3.1 or at least a direction I can be pointed in, before I send out an example & code. Don't know if I should be setting focusable on toolwindows when creating,for instance?

PS. I did have a similar type of issue which I reported (after upgrading from 5.2.2. to 5.2.3) a few months ago. with a different activex component causing an issue with not triggering the "WindowActivatedEvent" - which I needed to be triggered to set global variables - when I initially activated the toolwindow. I got around this by setting the content to nothing, then activating the toolwindow (therefore triggering the event OK), then setting the content to the activex component.


Comments (2)

Posted 14 years ago by Actipro Software Support - Cleveland, OH, USA
Hi Bret,

You might try wrapping your Interop/ActiveX control in a Grid, instead of having it as a direct child of the ToolWindow. Also, you can try setting Focusable to true on the Grid.

In general, clicking the ToolWindow title will try to pass the focus to the first focusable element of the ToolWindow. Due to issues with Interop, passing the focus to an Interop/ActiveX isn't always reported (such as raising PreviewGotKeyboardFocus). The DockSite uses PreviewGotKeyboardFocus to track the "active" window.

We did make a change in WPF Studio 2010.1 build 0523 relating to passing focus to Interop controls. Are you experiencing the issue with build 0523, or just WPF Studio 2010.2 build 0531?

Actipro Software Support

Posted 14 years ago by Bret Naughton
It also happened in 0523, but I have now resolved by adding the windows forms host to the grid as you mentioned. All works fine now...

Thanks again
The latest build of this product (v24.1.2) was released 3 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.