以编程方式更改DockWindow的宽度

时间:2013-01-30 07:16:43

标签: c# winforms telerik width

我有以下代码:

var hWindow1 = new HostWindow(new Control() {Dock= DockStyle.Fill}, DockType.ToolWindow);
radDock1.DockWindow(hWindow1, DockPosition.Left);

var hWindow2 = new HostWindow(new Control() { Dock = DockStyle.Fill }, DockType.ToolWindow);
radDock1.DockWindow(hWindow2, DockPosition.Bottom); 

var hWindow3 = new HostWindow(new Control() { Dock = DockStyle.Fill }, DockType.ToolWindow);
radDock1.DockWindow(hWindow3, DockPosition.Right);            

var hWindow4 = new HostWindow(new Control() { Dock = DockStyle.Fill }, DockType.Document);            
radDock1.DockWindow(hWindow4, DockPosition.Fill);

var hWindow5 = new HostWindow(new Control() { Dock = DockStyle.Fill }, DockType.Document);
radDock1.AddDocument(hWindow5, hWindow1, DockPosition.Fill);

如何以编程方式更改某些DockWindow的宽度(例如hWindow3)?

1 个答案:

答案 0 :(得分:0)

假设您的容器是“容器”。您可以将SizeMode设置为Absolute并设置所需的大小。 这link非常好。

Container.SizeInfo.SizeMode = SplitPanelSizeMode.Absolute;

Container.SizeInfo.AbsoluteSize = new Size(desiredWidth,desiredHeight);