C # / winforms layout: element with right or bottom anchor disappears under parent container
sometimes when I want a winforms control to be docked as well to the right or bottom of the parent container (usually a UserControl), its borders are expanded beyond the parent's right or bottom border so that some of it is not visible anymore. even if the anchor is set to the right.
This only happens when the application starts. while I'm in the designer everything looks fine.
all I do is set the Anchor property of the Right control, for example.
Is there a way to avoid this?
In this screenshot, you can see the Transition group box expanding as the parents expand to the right.
http://www.deviantsart.com/upload/08ffe2f5e7f4d33044840e68e0619152.png
thanks!
a source to share
If you are using Anchor, you will not be able to use the Dock (and vice versa).
Anchor and dock properties are mutually exclusive. Only one can be installed at a time, and the last installed has priority.
I would check if your control is the main control it thinks is its parent :-)). Also check the property Margin
on the control and Padding
on the parent control. Then check the property AutoSize
.
a source to share
I'm not really sure what you are talking about. Can you change the proposal?
If you say that when you resize the parent window, you want the control to resize as well, you are on the right track. You have to change the anchor so that the control is anchored to the left, top, right and bottom.
a source to share
If you want to dock to the right, at a constant height: anchor: = top, right If you want to dock to the bottom-right corner: anchor: = bottom, right
Which parent container do you go to? Is the control inside the parent? If not, then it can resize on top of it (since it's not really a child).
a source to share