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 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.
Please let me know if you have any further questions.
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!
Hello Eric,
Thanks a lot for verifying my answer.
Please, do not hesitate to contact me if you have any additional questions.