views:

252

answers:

1

Hello,

I have a custom control that uses a designer I've inherited from ParentControlDesigner to allow child controls to be dropped. I'm not using any internal designers, just straightforward single-parent stuff.

This control draws a "header", so I'm trying to do three things:

  1. Have child controls dock to the bottom of the header instead of the top of the control, when set to Top or Fill.

  2. Have child controls snap to the bottom of the header when dragging with the mouse, instead of the top of the control.

  3. Prevent controls from being dragged onto the header area, period (I have a feeling this may not be possible).

(1) is the most important - I know it's possible because I've seen other controls that do it. (2) would also be a major help. (3) I don't care about that much, it would just be nice to have.

Would anyone be able to point me in the right direction on how to implement these rules, without having to resort to a clumsy sub-panel and the InternalControlDesigner methods?

A: 

Prevent controls from being dragged onto the header area, period (I have a feeling this may not be possible)

Having the control (the control itself, not the designer) override Control.DisplayRectangle.get may help restrict its children.

Ilya