Dragging the form.... please help!
-
Hi there, I am creating a Windows form, of which, I have removed the title bar which addresses the Minimize, maximize and close buttons, by defining the FormBorderStyle entry as None. However, I have added the minimize and close button on the top right corner of my Border/Title less form. But the problem is, when I try to drag the form from one location of the desktop to another, it doesn't seem to move and remains static in its original location. Can anyone offer me a solution to this? Your help will greatly be appreciated, Thanks, Rajdeep.NET
-
Hi there, I am creating a Windows form, of which, I have removed the title bar which addresses the Minimize, maximize and close buttons, by defining the FormBorderStyle entry as None. However, I have added the minimize and close button on the top right corner of my Border/Title less form. But the problem is, when I try to drag the form from one location of the desktop to another, it doesn't seem to move and remains static in its original location. Can anyone offer me a solution to this? Your help will greatly be appreciated, Thanks, Rajdeep.NET
-
Just add this code to your form :)
protected override void WndProc(ref Message m) { if (m.Msg == 0x0084 /\*WM\_NCHITTEST\*/) { m.Result = (IntPtr)2; // HTCLIENT return; } base.WndProc(ref m); }
Here's where .net is really useful !
2 bugs found. > recompile ... 65534 bugs found. :doh:
-
Just add this code to your form :)
protected override void WndProc(ref Message m) { if (m.Msg == 0x0084 /\*WM\_NCHITTEST\*/) { m.Result = (IntPtr)2; // HTCLIENT return; } base.WndProc(ref m); }
Hi T_Lokzz, Thanks for your help man :-D , the code really worked out!!!!! I'm feeling so happy.... thank you once again,:thumbsup: Rajdeep.NET
-
Hi T_Lokzz, Thanks for your help man :-D , the code really worked out!!!!! I'm feeling so happy.... thank you once again,:thumbsup: Rajdeep.NET