I am making a windows Winform with a custom resizer(no border). I draw a resizer grip and handle some messages in WndProc. Just a heads up: I don't know what happens inside the WndProc, I just know it does what I want it to do(I pasted as snippet from somehwere).
Now I want to add a panel that is docked to the bottom of my form. When I do this, however, my resizing functionality is gone. Is there some way to restore this functionality without having to program my own resizer in.
I would think the functionality is lost because it only handles the resizing on the main form and not on any of its controls.
protected override void WndProc(ref Message m)
{
if (m.Msg == 0x84)
{ // Trap WM_NCHITTEST
Point pos = new Point(m.LParam.ToInt32());
pos = this.PointToClient(pos);
if (
pos.X >= this.ClientSize.Width - cGrip &&
pos.Y >= this.ClientSize.Height - cGrip)
{
m.Result = (IntPtr)17; // HTBOTTOMRIGHT
return;
}
}
base.WndProc(ref m);
}
As I said in previous questions, I am not an experienced C# programmer at all. I have very little experience and the methods I use can probably be insanely optimized, so a detailed description of your answer would be very appreciated.