2

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.

Vaf Daf
  • 57
  • 1
  • 6
  • the question will be "what does docking the panel do to the non-clientarea of your form". this is difficult to tell without a possibility to reproduce. could you add the source of the form design too? – Cee McSharpface Jun 29 '18 at 10:47
  • related: https://stackoverflow.com/questions/40443474/cant-resize-a-borderless-winform-from-top-because-of-a-docked-panel and strongly related if not duplicate https://stackoverflow.com/q/32310319/1132334 – Cee McSharpface Jun 29 '18 at 10:53
  • Possible duplicate of [Resize a borderless form that has controls everywhere, no empty space](https://stackoverflow.com/questions/32310319/resize-a-borderless-form-that-has-controls-everywhere-no-empty-space) – Cee McSharpface Jun 29 '18 at 21:20

0 Answers0