带分离器的面板布局
我有一个关于 DevExpress 的 TPanels 和 TcxSplitter 布局的问题。 面板布局 http://pp.kpnet.fi/bengtsson/temp/layout.png
主窗体有一些面板 A 到 G。A - F 收集在一个面板 ABCDEF 中。 ABCDEF 包含 3 个面板: AB、CDE 和 F。 面板CDE包含面板CD。
在面板之间的所有限制之间有一个来自 DevExpress 的 TcxSplitter。 问题是用户可以将 ABCDEF 和 G 之间的分离器移动到左侧,以便到达面板 AB 并覆盖面板 CDE。我不想允许这样的事情发生。
相反,我希望面板 CDE 的最小宽度为 5 像素。那么面板AB的宽度应该缩小。希望我解释得足够好:) 我尝试在面板 CDE 上设置constraint.minwidth = 5,但面板仍然可以隐藏。也许 Devexpress 有一些很好的解决方案?
问候
I have a question about layout with TPanels and TcxSplitter from DevExpress.
panellayout http://pp.kpnet.fi/bengtsson/temp/layout.png
The main form has some panels A to G. A - F is collected in one panel ABCDEF.
ABCDEF contains 3 panels:
AB, CDE and F.
Panel CDE contains panel CD.
Between all limits between panels there are a TcxSplitter from DevExpress.
The problem is that the user can take the splitter between ABCDEF and G and move it to left so it reach panel AB and cover panel CDE. I don't want to allow that.
Instead I want panel CDE have a minimum width of say 5 pixels. Then the width of panel AB should be shrinked. Hopefully I explained good enough :)
I have tried to set a constraint.minwidth = 5 on panel CDE but the panel can still be hided. Maybe Devexpress have some nice solution for this ?
Regards
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
cxSplitter 具有 MinSize 属性,从我在测试应用程序中看到的情况来看,调整大小时会尊重它。由于只有 1 个 MinSize 属性,因此会检查拆分器两侧的面板,因此您不能为拆分器的一侧指定最小 50 个像素,而为拆分器另一侧的面板指定 100 个像素。但请确保 AutoSnap 属性为 false。
但拆分器上还有一个 OnCanResize 事件,因此您也可以防止在那里调整大小。
另外,由于您使用的是 devex,我建议您使用dockSite/dockPanel 或LayoutControl v2 而不是普通的Delphi TPanel。
cxSplitter has MinSize property, from what I see in a test app, it is respected when resizing. Since there is only 1 MinSize property, it is checked for panels on either side of splitter, so you can't specify say 50 pixels minimum for one side and 100 for the panel on the other side of the splitter. Make sure the AutoSnap property is false though.
But there is also a OnCanResize event on the splitter, so you can prevent resize there as well.
Also, since you're using devex I would suggest you use either dockSite/dockPanel or LayoutControl v2 instead of plain Delphi TPanel.
试试这个属性
Try this property