If I have a form in my project for which I have set the border style to
None, I can use the code below to enable moving the form by clicking
and dragging anywhere on the form:
protected override void WndProc(ref Message m)
{
const int WmNcHitTest = 0x84;
const int HtCaption = 2;
if (m.Msg == WmNcHitTest)
m.Result = new IntPtr(HtCaption);
else
base.WndProc(ref m);
}
It works quite well and the form moves smoothly.
My next question concerns having a panel on the form that completely
covers the form's surface. Is there any way to allow the same
functionality by clicking and dragging on the panel so that the entire
form moves? I would prefer to use a method similar to above rather
than mouse events. Is it possible?
Thanks,
Chris