954,514 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Resize borderless window using custom grip component

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?

Thew
Junior Poster in Training
61 posts since Jan 2008
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: