MasterRacker
Active member
I have a borderless form that I need to be able to drag around the screen via its' body. I found this override to be added to the form :
This works fine for the most part. I'm guessing this somehow modifies the click event to make the entire window behave like a title bar. The unfortunate side effect is that double-clicking the form maximizes it. I had a double-click event defined to close the form, but this override seems to be processed first, rendering my event useless.
Can anyone suggest a modification to only allow dragging?
Jeff
[purple]It's never too early to begin preparing for [/purple]International Talk Like a Pirate Day
"The software I buy sucks, The software I write sucks. It's time to give up and have a beer..." - Me
Code:
protected override void WndProc(ref Message msg)
{
if (msg.Msg == 0x0084) // WM_NCHITTEST
msg.Result = (IntPtr) 2; // HTCAPTION
else
base.WndProc(ref msg);
}
Can anyone suggest a modification to only allow dragging?
Jeff
[purple]It's never too early to begin preparing for [/purple]International Talk Like a Pirate Day
"The software I buy sucks, The software I write sucks. It's time to give up and have a beer..." - Me