Hi,
I have this code to move a borderless form which it works great. However when I double click the form it maximizes the form which I don't want.
I really need to disable the maximizing on double-click.
BTW, this is VS2003VB Code:
private const int WM_NCHITTEST = 0x84; private const int HTCLIENT = 0x1; private const int HTCAPTION = 0x2; protected override void WndProc(ref System.Windows.Forms.Message m) { switch (m.Msg) { case WM_NCHITTEST: base.WndProc(ref m); if (m.Result.ToInt32() == HTCLIENT) m.Result = new IntPtr(HTCAPTION); break; //If m.Result.ToInt32 = HTCLIENT Then m.Result = IntPtr.op_Explicit(HTCAPTION) 'Try this in VS.NET 2002/2003 if the latter line of code doesn't do it... thx to Suhas for the tip. default: //Make sure you pass unhandled messages back to the default message handler. base.WndProc(ref m); break; } }




Reply With Quote