Question

How to Find active Tab in Tabbed MDI

Posted 6 years ago by Avatar United Biosource - United Biosource
I want my Tabbed MDI page to register command bindings to the common windows commands (Save, Edit, etc.) and then call a command on a control in an MDI Container as appropriate, but I don't see how to get a reference to the Active window within the MdiContainer. MainDockSite.ActiveWindow doesn't restrict possible windows to only those in the MDI container. How can I do this?

Thanks.

Comments (4)

Posted 6 years ago by United Biosource - United Biosource
Found it, I think:

var window = MyMdiContainer.SelectedWindow.Content;

or just

var window = MyMdiContainer.SelectedWindow;

if you only wanted the tab window rather than the control inside it
Posted 6 years ago by Actipro Software Support - Cleveland, OH, USA
Sydney,

Never track container instances since they are transient and are created/destroyed at run-time as needed.

Instead use DockSite.LastActiveDocument. That should give what you wanted.

Actipro Software Support
Posted 6 years ago by United Biosource - United Biosource
Will this work even if

a) a user has clicked on one of the Toolbars in the DockSite that is not in the Workspace
b) I don't have any Documents in my workspace, just tool windows
Posted 6 years ago by Actipro Software Support - Cleveland, OH, USA
Yes it should. The term "document" means any document window or tool window in the MDI area.

Actipro Software Support
Information The latest build of this product (2014.2 build 0610) was released 1 month ago, which was after the last post in this thread.

Add a Comment

Please log in to a validated account to post comments.