Hinge order in Toolstrip container

I have a dashboard container with two dashboards. I want one of them to appear on top of the other. I tried installing Dock to Top for one and for Bottom for another, but they still appear randomly. I also tried using TopToolStripPanel.Controls.SetChildIndex (...), but this did not affect. Even the same executable file on two different computers gives a different order. Is there any way to force an order? Thanks

+4
source share
1 answer

Add these lines of code after InitializeComponent();to the form constructor to verify your specific order. This fixes any corrupted settings in the code generated by the constructor:

toolStripContainer1.TopToolStripPanel.SuspendLayout();
toolStrip1.Dock = DockStyle.None;
toolStrip2.Dock = DockStyle.None;
toolStrip1.Location = new Point(0, 0);
toolStrip2.Location = new Point(0, toolStrip1.Height);
toolStripContainer1.TopToolStripPanel.ResumeLayout();
+2
source

All Articles