Hi
I have created a form that has a toolstrip (plain old Windows.Forms.Toolstrip) at the top.
This form also has a UltraDockManager containing 2 panels. The first panel is DockedLeft. The second one is DockedBottom.
When I resize the form small enough, the bottom panel overwrites my toolstrip.
I have attached a sample showing this behavior.
How to prevent that?
Hello Eric,
One possible workaround for the issue you’ve got is to use the ContainerControl. That control function as a container for other controls and provides focus management. So, drag the control from the toolbox and dock it to the form. Add the desired controls in the container and set it to the HostControl property of the UltraDockManager(this property could be set only in runtime ). In that way when you resize the form UltraDockManger will be resized in the frame of the host control, without affecting your menus.. More information about ContainerControl and HostControl property you could find on the following links:
http://msdn.microsoft.com/en-us/library/system.windows.forms.containercontrol%28v=vs.110%29.aspx
http://help.infragistics.com/doc/WinForms/2014.1/CLR4.0/?page=Infragistics4.Win.UltraWinDock.v14.1~Infragistics.Win.UltraWinDock.UltraDockManager~HostControl.html
I’ve implemented this suggestion in a simple sample, and you could run and evaluate it, please see attached zip.
Please let me know if you have any further questions.
I seriously thought you got it but ... our real application is just a bit more complex!
We let the user save/restore layout.
When I restore the layout, the whole dockmanager disappear!
I have attached another example. Just launch it and click the restore button to see the impact.
Thank you for clarifying your for clarifying your scenario. Based on the new information I’ve made new investigation of the issue and I found more stable solution for you. I’ve implemented a few methods that will prevent docked controls in an UltraDockManager from overlapping when the form is small. More detailed information about this workaround you could find here:
http://devcenter.infragistics.com/Support/KnowledgeBaseArticle.Aspx?ArticleID=7706
I have implemented that workaround in your sample, and you could run and evaluate it, please see attached zip.
I hope that this will help you.
Do not hesitate to contact me if you have any additional questions.
Thanks a lot for verifying my answer.
Please, do not hesitate to contact me if you have any additional questions.
Hello Erick,
What I could suggest you as a simple workaround is to modify your code in ApplayLAyout as following:
void ApplyLayout()
{
using (var stream = new System.IO.MemoryStream(Encoding.UTF8.GetBytes(_layoutXml)))
ultraDockManager1.LoadFromXML("MyFile.xml");
this.Size = new Size(this.Width + 1, this.Height + 1);
this.Size = new Size(this.Width - 1, this.Height - 1);
}
Which will perform UlatraDockManager to refresh its layout based on the size of the from. Also I want to highlight that the designed behavior of the UlatraDockManager is: when you save layout, the UDM saves the exact sizes of the panes and not their relative sizes. So when you load the layout component restores the original panes’ sizes.
I hope that this will helps you.
I am aware that the size of the form changed but it is not a reason why the panel should be of a size that makes no sense for the new size of the form. What would be the best way to catch the newly applied/restored layout don't make sense?
The test is not correct since the condition to which you’ve saved the layout are not the same in which you load it. UltraDockManger actually set the exact sizes and positions of its dock panels and they do not appears well since the form is not with the same size as during the save. So in this case I believe that you also should have some mechanism which will saves and restores the size of your form. Then this issue will not occurs.
My QA person just found another issue with the proposed solution. This new problem occurs when resizing.
enlarge the form, make the botton panel big as well and save layout
now reduce the height of the panel, reduce the size of the form and click Restore.
The bottom panel will once again override the the toolstrip.
Can we limit the height when restored to the place available?
I have attached a video. If a picture is worth a thousand words, imagine a video!