I don't think there is any support for dragging forms out of the MdiTabbedManager, but I was hoping to implement some mechanism to do that. Does anybody know if this is at all possible?
Alternatively is it possible to add additional tools to the context sensitive menu to take the form out of the Tabbed Manager?
I think all I need to do is to write something like this to get the form out:
form.MdiParent = null;
I'm just looking for a good place to let the user do it.
Regards,
Martin.
I'm getting somewhere with this but the method I have come up with seems quite buggy to say the least. Here is the code:
// *************************************************************************************************** private void TabbedMdiManager_InitializeContextMenu(object sender, MdiTabContextMenuEventArgs e) { MenuItem item = e.ContextMenu.MenuItems.Add("Detach", TabbedMdiManager_DetachClicked); item.Tag = e.Tab; } // *************************************************************************************************** private void TabbedMdiManager_DetachClicked(object sender, EventArgs e) { MenuItem item = sender as MenuItem; if (item != null) { MdiTab tab = item.Tag as MdiTab; if (tab != null) { Form form = tab.Form; form.MdiParent = null; } } }
Two problems with this, first the item in the context menu looks weird (I may be able to fix this by playing the the MenuItem properties):
Secondly when the form is detatched it doesn't have a ribbon and it has two borders around it:
I have a feeling I'm not doing it the way I'm supposed to. Or was it even designed to support the ability to switch between a tab and an a form on its own?
Any ideas?
This seems to fix the issue with the context menu:
MenuItem item = new IGMenuItem("&Detach", TabbedMdiManager_DetachClicked); e.ContextMenu.MenuItems.Add(item); item.Tag = e.Tab;
But I still don't know what to do about the form missing its ribbon and having two borders though.