[RESOLVED] User-resizable container
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: [RESOLVED] User-resizable container

  1. #1
    Join Date
    May 2007
    Location
    Denmark
    Posts
    623

    [RESOLVED] User-resizable container

    Hi all,

    I've been googling for a while but I've come up empty-handed. I need a container-control not unlike the GroupBox, but one that allows the user to resize it at runtime.
    Does anyone know of a control that can do this / how to configure a control to allow it?

    Thanks
    It's not a bug, it's a feature!

  2. #2
    Join Date
    Mar 2004
    Location
    3311'18.10"N 9645'20.28"W
    Posts
    1,808

    Re: User-resizable container

    I saw the suggestion on the other forum, but this one has formatting, so...

    at a minimum you could set the sizebox style for a panel (though it gives a raised 3d border) which will allow the control to be sized by a user:

    Code:
    public class SizeablePanel : ContainerControl {
        const int WS_SIZEBOX = 0x00040000;
        protected override CreateParams CreateParams {
            get {
                CreateParams cp = base.CreateParams;
                cp.Style |= WS_SIZEBOX;
                return cp;
            }
        }
    }
    Last edited by MadHatter; July 9th, 2009 at 10:49 AM.

  3. #3
    Join Date
    May 2007
    Location
    Denmark
    Posts
    623

    Re: User-resizable container

    Quote Originally Posted by MadHatter View Post
    I saw the suggestion on the other forum, but this one has formatting, so...

    at a minimum you could set the sizebox style for a panel (though it gives a raised 3d border) which will allow the control to be sized by a user:

    Code:
    public class SizeablePanel : ContainerControl {
        const int WS_SIZEBOX = 0x00040000;
        protected override CreateParams CreateParams {
            get {
                CreateParams cp = base.CreateParams;
                cp.Style |= WS_SIZEBOX;
                return cp;
            }
        }
    }
    I love you I love you I love you I love you I love you

    Excellent stuff mate! It does pretty much exactly what I want
    It's not a bug, it's a feature!

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center