gpt4 book ai didi

c# - 以编程方式更改 DockWindow 的宽度

转载 作者:行者123 更新时间:2023-11-30 13:02:44 25 4
gpt4 key购买 nike

我有以下代码:

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)的宽度?

最佳答案

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

Container.SizeInfo.SizeMode = SplitPanelSizeMode.Absolute;

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

关于c# - 以编程方式更改 DockWindow 的宽度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14598563/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com