A: 

I'm not exactly sure what you are saying. Can you reword the sentence?

If you are saying that when you resize the parent window, you want the control to also resize, you are on the right track. You should change the anchor so that the control is anchored to left, top, right, and bottom.

MedicineMan
yes, i know, it is hard to describe, but i will edit my post and reword it
clamp
A: 

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

What parent container are you docking in? Is the control inside the parent? If not, then it can resize over the top of it (since its not actually a child).

Andrew Backer
the parent container is a custom UserControl
clamp
A: 

Can you post a screen shot of what it is doing? That might clear of the confusion.

auujay
yes, i will make a screenshot asap.
clamp
screenshot posted.
clamp
A: 

You probably have to mess around with the z-order of the controls.

Richard Hein
+2  A: 

Check your parent (UserControl) dock and anchor properties. It appears to me that they have not been set and the UserControl not the items in the UserControl are extending past the borders.

Chris Persichetti
thanks, yes the parent container is indeed the problem. sorry for the misunderstanding. it's anchor is set to top,left,right and then this problem happens!
clamp
A: 

Perhaps the anchoring is fine, but the problem is in the rendering. Have you tried calling Invalidate() in your container control? I remember something similar happened to me a long time ago with a custom control. And I resolved it by forcing a repaint of the control.

Gerardo Contijoch
+1  A: 

If you use Anchor then you cannot use Dock (and vice versa).

The Anchor and Dock properties are mutually exclusive. Only one can be set at a time, and the last one set takes precedence.

I would check if your controls' parent is actually the control you think it is (it could be its parent :-) ). Also check Margin property on the control and Padding property on the parent control. Then check AutoSize property.

van