Using the example image can you tell me how to do the following actions programmatically in C#.
The document windows (A1, B1 & C1) have been created using
where control is a standard WinForms UserControl in each case.
1) How would I replace the control "B1" with another control "D1" i.e. assuming the tab is index of B1 is 10 in the DockingManager.ControlsArray property how can I do this
var D1 = new UserControl() ;
DockingManager.ControlsArray = D1;
The line above just seems to destroy the existing "B1" but doesn't replace it with "D1"
2) How do I programmatically close a tab so the control within the tab gets disposed . I can set the tabs visibility using DockingManager.SetDockVisibility(B1, false) but this doesn't cause the tabs control to get disposed. There doesn't seem to be an API call like DockingManager.CloseTab(B1) that I can find.
3) How do I programmatically change the order of the tabs so that for example the display as B1, A1, C1 instead of A1, B1, C1. Using DockingManager.SetTabPosition doesn't seem to work on DocumentMode tabs and results in either an exception or killing the content of the tab.
Sorry for the delay in getting back to you,
You can programmatically close the tab by disabling the docking of the tab. Please refer to the sample and the video for your reference.
We have logged a feature request for your requirement “Provide support to rearrange the Document Window” and it can be tracked through our feedback portal below.
We will prioritize the features every release based on the demands, and we do not have an immediate plan to implement this since we committed to already planned work. So, this feature will be available for any of our upcoming releases.
Please cast your vote to make it count and if you have any more specifications/suggestions for the feature request, you can add them as a comment in the feedback portal.
Once the above feature is implemented, you can replace a tab by removing and inserting items in a specific index.