Member Avatar for Thew
Thew

Hello,
how can I resize a borderless window with a custom component (something like status bar) that docks at the bottom part of my window. I draw a sizing grip in the bottom right corner of my scustom tatus bar. I was able to implement functionality for my borderless window to resize but my status bar covers the area so I thought this code:

protected override void WndProc(ref Message m)
{
    if (m.Msg == (int)Lizard.Windows.Native.NativeMethods.WindowMessages.WM_NCHITTEST && panelEnableGrip && Enabled)
    {
        Point pos = new Point(m.LParam.ToInt32() & 0xffff, m.LParam.ToInt32() >> 16);
        pos = this.PointToClient(pos);
        if (pos.X >= ClientSize.Width - 16 && pos.Y >= ClientSize.Height - 16)
        {
            m.Result = (IntPtr)Lizard.Windows.Native.NativeMethods.NCHITTEST.HTBOTTOMRIGHT;
            return;
        }
    }
    base.WndProc(ref m);
}

should do the work. I know it just resizes my custom control, but can it be modified so the parent window will be resized?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.