On Mar 7, 2:55 pm, Jeff Williams <jeff.willi...@hardsoft.com.au>
wrote:
I need to be able to drag a window around by clicking on the background
of the window.
This windows does not contain a title bar. This would be like some on
screen post-it note applications use.
Would appreciate help with the code or a link to an app which would show
how to do this.
Thanks in advance.
Jeff
Jeff,
Copy paste this code into your form on which you need to drag clicking
the background.
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);
}
hope that helps :)
Mugunth