-
Moving Window
I want to hide the normal title bar, but I also want the user to be able to drag the window around.
I was thinking of putting a transparent panel and putting it on the "drag spot", putting a mouse down event to it, but then I just need to know how to get where the mouse is and to relocate the windows etc.
Any help would be great :) Thanks in advance ;)
-
I was doing this just the other day and ran across this code snippet. This will allow the user to drag the form by clicking and holding any blank part of the form. This may not be exactly what you want, but it's an alternative.
PHP Code:
protected override void WndProc(ref System.Windows.Forms.Message m)
{
base.WndProc(ref m);
if (m.Msg == 0x84)
if (m.Result.ToInt32() == 1) m.Result = new IntPtr(2);
}
I'm not sure exactly what it's doing, since whoever wrote this didn't use the WM_ constants, but it works for me :D
-
-
why when i just do :
Code:
protected override void WndProc(ref System.Windows.Forms.Message m) {
}
i get an error which says it couldnt create a handle? i am missing something?
-
ah found! had to do : base.WndProc(ref m);