This is a migrated thread and some comments may be shown as answers.

Sizing issues

3 Answers 107 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Adam
Top achievements
Rank 2
Adam asked on 02 Dec 2008, 05:30 PM
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?

3 Answers, 1 is accepted

Sort by
0
erwin
Top achievements
Rank 1
Veteran
Iron
answered on 02 Dec 2008, 10:06 PM
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
0
Adam
Top achievements
Rank 2
answered on 02 Dec 2008, 10:11 PM
Thanks Erwin, setting the size property (rather than the width) did the trick!
0
erwin
Top achievements
Rank 1
Veteran
Iron
answered on 03 Dec 2008, 08:40 AM
Glad I could be of help.

Erwin
Tags
Dock
Asked by
Adam
Top achievements
Rank 2
Answers by
erwin
Top achievements
Rank 1
Veteran
Iron
Adam
Top achievements
Rank 2
Share this question
or