G
Guest
I have a lingering problem with control docking and z-order.
As I understand it, the control docking order based on the control z-order.
So If I have two controls, Control1 & Control2 whose Dock properties are both
set to Top, the control that is "Top Most" will appear on the top. I tried
changing
the z-order in the designer for Control2 by selecting bring to front, but
when I show
the form, Control1 appear on top.
Programatically, I tried settting the z-order by calling the BringToFront
method
and then changing the Dock as follows:
Control1.Dock = DockStyle.None;
Control2.Dock = DockStyle.None;
Control1.Location = new point (0,0);
Control2.Location = new point (0,0);
Control2.BringToFront();
Control1.Dock = DockStyle.Top;
Control2.Dock = DockStyle.Top;
But this still does not work. How do I set Control2 to be on Top of the form?
I hope I don't have to muck around with the designer generated code.
I am using .Net 2.0.
Thanks
As I understand it, the control docking order based on the control z-order.
So If I have two controls, Control1 & Control2 whose Dock properties are both
set to Top, the control that is "Top Most" will appear on the top. I tried
changing
the z-order in the designer for Control2 by selecting bring to front, but
when I show
the form, Control1 appear on top.
Programatically, I tried settting the z-order by calling the BringToFront
method
and then changing the Dock as follows:
Control1.Dock = DockStyle.None;
Control2.Dock = DockStyle.None;
Control1.Location = new point (0,0);
Control2.Location = new point (0,0);
Control2.BringToFront();
Control1.Dock = DockStyle.Top;
Control2.Dock = DockStyle.Top;
But this still does not work. How do I set Control2 to be on Top of the form?
I hope I don't have to muck around with the designer generated code.
I am using .Net 2.0.
Thanks