Sizing issues

4 posts, 0 answers
  1. Adam
    Adam avatar
    89 posts
    Member since:
    Mar 2008

    Posted 02 Dec 2008 Link to this post

    I am trying to make a form with two UserDockControl panels on it.  The first should always be docked to the left and may be hidden or resized, but not closed.  Ideally I would like to have a minimum size on this dock so that it always looks nice and contains everything it should.  But I must be able to initialize the width so that when the form first shows up, it shows up with enough space.  The second panel will have an image displayed, so it needs to take all of the available space.

    Right now on my form I am using

    dockingManager.SetDock(LargeUserDockControl, DockPosition.Fill);
    dockingManager.SetDock(SmallUserDockControl, DockPosition.Left);

    What happens is that the LargeUserDockControl takes up too much space.  I have tried setting the size of SmallUserDockControl just about every where I can think.  I've tried changing PreferredSize, PreferredDockSize, MinSize, MinimumSize.  Any ideas?
  2. erwin
    erwin avatar
    358 posts
    Member since:
    Dec 2006

    Posted 02 Dec 2008 Link to this post

    Adam,

    I also had problems with setting sizes of a UserDockControl. I also have a explorer type dock control on the left that I initialize to a reasonable size. Following code (according to advice from telerik in an earlier thread) works for me:

    MyDockControl dockControl = new MyDockControl();
    _dockingManager.SetDock(dockControl, Telerik.WInControls.Docking.DockPosition.Left);
    dockControl.Size = new Size(_dockingManager.With/4,dockControl.Height); // set the user dock control to 1/4 of the with of docking manager

    Changing Height or Width Properties alone does not work for some reason. However, ymmv because I use dockable Documents on the right side, not another UserDockControl.

    Keep on docking!

    Erwin
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Adam
    Adam avatar
    89 posts
    Member since:
    Mar 2008

    Posted 02 Dec 2008 Link to this post

    Thanks Erwin, setting the size property (rather than the width) did the trick!
  5. erwin
    erwin avatar
    358 posts
    Member since:
    Dec 2006

    Posted 03 Dec 2008 Link to this post

    Glad I could be of help.

    Erwin
Back to Top