I wrote the WndProc
method for a moveable control such this:
protected override void WndProc(ref Message m)
{
const int WM_NCHITTEST = 0x0084;
if (m.Msg == WM_NCHITTEST)
{
base.WndProc(ref m);
if ((int)m.Result == 0x1)
m.Result = (IntPtr)0x2;
return;
}
base.WndProc(ref m);
}
and setted SizeAll
cursor for the cursor property. but when we set m.Result as i did, the cursor will be Default
in any case. How can i do?
WM_SETCURSOR
too. Also you should hanldeWM_NCLBUTTONDBLCLK
to prevent your control from being maximized when you double click on it: – Shahaptian