I've got the moving working, using this code:
Expand|Select|Wrap|Line Numbers
- this.Location = new Point((this.Location.X + e.Location.X), (this.Location.Y + e.Location.Y));
I can't for the life of me figure it out. Any help would be greatly appreciated.
As a side note, I'm also going to be doing this for resizing the form, and it's gonna do the same thing, snapping the size box (set into the corners of the form) so that the mouse is at the top-left of the size handle.
Edit: I found a way to make this work, but I'd still like other suggestions. Basically I created a second panel, exactly the same as the main movement panel, and in the same position, but hidden. When I mouse down on the main panel, it gets moved the the x,y coordinates of my mouse then sized down to 0x0, and the secondary panel is made visible. Since I'm moving based on the position of the main panel, and since no matter where I click it'll always be 0x0 (the top-left corner) since I resized, and the secondary panel behind it shows in the exact same place as the original, it looks as though you're grabbing the handle from wherever you clicked it at. Of course, this is a hack and I'd rather do it the right way, if there is such a way, so I'd still love some suggestions.