Thanks Paul and Morten!
I figured this out a few minutes after i originally posted.
Appreciate it! Thank you!
"Morten Wennevik [C# MVP]" <Mo************@hotmail.comwrote in message
news:op.tqdpvavjdj93y5@stone...
Hi Nathan,
As Paul said, if you set the custom panel's Padding you should be able to
prevent docking to cover the borders. Furthermore, overriding Padding in
the custom panel will help you prevent the user from manually covering the
borders.
private const minpadding = 2;
public new Padding Padding
{
get { return base.Padding; }
set
{
int l = value.Left < minpadding ? minpadding : value.Left;
int r = value.Right < minpadding ? minpadding : value.Right;
int t = value.Top < minpadding ? minpadding : value.Top;
int b = value.Bottom < minpadding ? minpadding : value.Bottom;
base.Padding = new Padding(l, t, r, b);
}
}
On Fri, 06 Apr 2007 20:18:54 +0200, Nathan Laff <re******@hotmail.com>
wrote:
I've got a custom Panel that draws a colored border for me. Works great,
however a new problem I've run into is this.
I have the custom panel, then I want to put another panel (just a
Windows.Forms.Panel) inside it, and dock it to the top. When i do this,
the
docked panel paints over the border of the custom panel where it is
docked,
so some of the left and right (the height of the child panel) and all of
the
top.
How can I force my custom panel to draw on top of the child panels? Or is
there another solution?
Please help, I've been spinning my wheels on this for a while now!
Thanks!
--
Happy coding!
Morten Wennevik [C# MVP]