I had placed three controls on a UserControl and had them all perfectly
docked together filling up the UserControl.
I needed to add a fourth controls docked to the top. So I dropped it on the
UserControl, changed the new control to Dock = top and changed the taborder
of all the other controls (bumped each up by 1) . But when I start changing
the other controls back to dock = left, fill, etc... they expand the entire
height of the form making the top controls appear to overlap all the other
controls . In a sense, the controls "slip" under the new 4th control.
If I were to remove them all and place new controls from scratch they all
appear fine and respect the control with the "Top" boundary - then it works
fine. But I would have to redo alot of settings if I took this route!!!
How can I make sure that any newly added controls dock appropriately with
the previous controls
Thanks
Sergey Poberezovskiy - 28 Dec 2005 02:25 GMT
I think I had a similar problem before - and it has something to do with the
order of the controls being added to a container.
In the "Windows Form Designer genereted code" locate the lines where the
controls in questions are added to the container, something similar to the
Me.Controls.Add(Me.myNewlyAddedControl) in VB, or
this.Controls.Add(this.myNewlyAddedControl) in C#.
Then move this line of code prior to the other docked controls and switch to
design view - now your controls should appear as you wanted them to..
As far as I understand TabIndex has nothing to do with that, though it is
always good to set it right.
HTH
> I had placed three controls on a UserControl and had them all perfectly
> docked together filling up the UserControl.
[quoted text clipped - 14 lines]
>
> Thanks
css - 28 Dec 2005 03:15 GMT
Nope - that didn't work. It must be something in the resx file.
Sergey Poberezovskiy - 28 Dec 2005 04:02 GMT
I think that I had it wrong - instead of moving the line of the
NewelyAddedControl up - move it down - that should do it
> Nope - that didn't work. It must be something in the resx file.
Chris Dunaway - 28 Dec 2005 14:21 GMT
Try selecting the controls that are "under" the 4th control and
choosing "Bring To Front" for that control. You can also experiment
with this on the other controls until you get them the way you want.
css - 28 Dec 2005 21:39 GMT
Chris,
That worked great. I actually had to change the control by "send to back"