We are using a UltraTabbedMdiManager for a C# winform application. Each tab is added one at a time and displays a unique form. The tab panel is nested within its parent form. We are experiencing two issues related to new tab creation.
Issue #1: On adding a new tab the entire tab plane shifts down exposing a strip at the top of the parent form (Mdi container), just below its title bar. When clicking on another tab or elsewhere on the parent form, the tab plane reverts to its original position. This strip only appears on creating a new tab and disappears as soon as the focus is lost (by clicking elsewhere). It also occurs only every second tab that is generated which suggests an activation focus issue on new tabs. The problem does not occur when clicking between already generated tabs or when removing tabs.
I have found a work around for this issue: After the creation of the tab and its form, iterate through all the tabs in the mdi manager and disable them. This iteration is then immediately repeated with enabling all the tabs. The new tab is then reactived. These steps force a loss and then regain of focus and then activation of the tab (N.B. without activation the previous tab will be active). The following is a (verbose) piece of my code which does this operation:
var activeTab = MdiTabManager.ActiveTab; foreach (var tabgroup in MdiTabManager.TabGroups) { foreach (var tab in tabgroup.Tabs) { tab.Form.Enabled = false; } }
foreach (var tabgroup in MdiTabManager.TabGroups) { foreach (var tab in tabgroup.Tabs) { tab.Form.Enabled = true; } } activeTab.Activate();
Issue #2: On the generation of some new tabs. The form shifts down and the controls at the top of the previous tab are displayed (but are inactive) on the new tab. It is as if they were superimposed onto the new tab. A similar work around like before resolves this issue; I had read this on another infragistics forum post. However this time the tab's form ShowInTaskbar property is set to false and then true (after iterating through all the mdi managers tabs).
It is possible that the two issues are related. Do you know if these are known issues? If so, has it been solved in later versions?
Just for further information about our application. The form, that contains the mdi manager, is launched from our application's main form. This main form also uses a UltraTabbedMdiManager but does have these issues. Therefore are there known problems with having more than one mdi manager in the same project or solution ?
Here are our environment details:
Infragistics v14.1, .Net v4.7, Visual Studio 2017 Enterprise, C# 7.0, WinForms
Thanks
Andrew
In fact the workaround(s) have side-effects if relying on the Application.OpenForms collection. Calling ShowInTaskbar will effectively remove the open forms from this collection (a known Windows form bug as described here https://stackoverflow.com/questions/3751554/application-openforms-count-0-always). Unfortunately my application relies on this collection. So my workaround is not applicable to my application. However, it could be useful to other designs not relying on the OpernForms collection.
Hello Andrew,
Thank you for posting in our forums!
Since you are using an older version, it is possible this has been fixed in newer versions. I recommend updating to the latest version of 17.2 and testing if this is resolved.
If the issue still occurs, the best way for us to assist you is if you provide a small, isolated sample that we can run and use for debugging locally.
If you are unable able to provide an isolated sample I may be able to give suggestions if you provide the code for your form.