Any event fires when a docuement window tabstrip clicked?

Docking/MDI for Windows Forms Forum

Posted 17 years ago by Roger Rong
Avatar
The DockManager.WindowFocused event fires when a document window tabstrip is clicked when it is NOT the current focused window. But after the docuement window is focused by clicking its tabstrip this event does not fire when users click the tabstrip again.

In our situation we need to trap the event whenever users clicks the document window tabstrip. We tried the documentWindow.Click and documentWindow.MouseClick events, but none of them fired.

So what is the best way for us to trap the operation of users clicking the docuement window tabstrip?

Any help would be appreciated.



(We are using UIStudio Version 1.5.43.0.)

Comments (8)

Posted 17 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Roger,

Hmm... the only way you could do that is to perhaps go up the parent tree and tie to the TabStrip.Reselect event. That fires when an already selected tab is clicked again. The only issue is that document windows can be dragged to new tabbed areas. So when the Parent of the document window changes, you would need to reattach to the new parent TabStrip, if any.


Actipro Software Support

Posted 17 years ago by Roger Rong
Avatar
Thanks for your quick response. I think I may have used the wrong term “tabstrip”, which was a little bit confusing.

What we are doing is trying to trap users clicking the little tab bar (that little area on the top of the document window in which has the title text) of the document windows, instead of the other Actipro control TabStrip/TabPages.

Or say the document window parent (its TabbedMdiContainer) can somehow turns to be a TabStrip?
Posted 17 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Actually those are TabStrip controls used behind the scenes to provide the tabs for the document windows, if I understand correctly what you are referring to.

So internally the control structure looks like:
HostContanerControl (your Form for example)
TabbedMdiRootContainer
TabbedMdiContainer
TabStrip
TabStripPage
DocumentWindow or ToolWindow

So I do think that what I originally said is applicable.


Actipro Software Support

Posted 17 years ago by Roger Rong
Avatar
Thanks for the updating.

It seems that the TabStrip is not a public member, so I made it go by using the Reflection to access the private TabStrip field of the TabbedMdiContainer class. Hopefully my hack code still works when we update to UIStudio 2.0 version in the futuure.
Posted 17 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
The dock controls in v2.0 are pretty similar to v1.5 with a lot of enhancements. But the core object model is probably about the same. So this should work there too.

An alternate way is to just enumerate either down through the Controls collection of the TabbedMdiContainer (to avoid reflection) or up the Parent chain from a DocumentWindow to get the TabStrip.


Actipro Software Support

Posted 15 years ago by Roger Rong
Avatar
This solution has been working fine for quite while until recently some users moved the document window to a new TabbedMdiContainer by clicking the "New Horizontal/Vertical Tab Group" - the original tree structure broke at this stage.

My question is that any event fires to identify this operation? If yes, some code could be put there to trace the new "TabbedMdiContainer".
Posted 15 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Roger,

You should be able to attach to the dockManager.TabbedMdiRootContainer.ControlAdded and ControlRemoved events to know when tabbed MDI containers are added/removed.


Actipro Software Support

Posted 15 years ago by Roger Rong
Avatar
Thakns, that is exactly the event I am after - and it works.
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.