为什么我的 TSplitter 位于错误的位置?
我有一个对话框,布局如下:
---------------------------------------------
| |
| CONFIG AREA |
| Align: alTop |
--------------------------------------------- <-static boundary
| |
| DISPLAY AREA 1 |
| Align: alTop |
============================================= <-TSplitter Align: alTop
| |
| DISPLAY AREA 2 |
| align: alClient |
--------------------------------------------- <-bottom of dialog
但是,在运行时,拆分器不会显示在显示区域 1 和显示区域 2 之间,而是显示在配置区域和显示区域 1 之间,从而导致一些烦人的界面问题。表单的设置相关事件处理程序中没有任何内容可以更改任何这些组件的 Visible 或 Align 属性。有谁知道为什么拆分器没有加载到它在表单设计器中的位置?
I've got a dialog that's laid out something like this:
---------------------------------------------
| |
| CONFIG AREA |
| Align: alTop |
--------------------------------------------- <-static boundary
| |
| DISPLAY AREA 1 |
| Align: alTop |
============================================= <-TSplitter Align: alTop
| |
| DISPLAY AREA 2 |
| align: alClient |
--------------------------------------------- <-bottom of dialog
However, at runtime, the splitter doesn't show up between Display Area 1 and Display Area 2, but between Config Area and Display Area 1, leading to some annoying interface problems. There's nothing in the form's setup-related event handlers that alters the Visible or Align properties of any of these components. Does anyone know why the splitter isn't loading in the place it's positioned at in the form designer?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
更多
发布评论
评论(3)
(无法重现。)分离器是很棘手的东西。我总是编写代码来定位它们。在这种情况下,我会做
(Can't reproduce.) Splitters are tricky things. I always write code to position them. In this case, I would do
我过去也遇到过类似的问题。它们是由以下原因引起的:
我认为分割器是在配置区域之后和显示区域1之前创建的。如果你在显示区域 1 之后创建它应该没问题。
I have had similar problems in the past. They were cause by:
I think the splitter is created after config area and before display area1. If you create it after display area 1 it should be fine.
我过去也遇到过同样的问题。 TSplitter 应放置在两个 TPanel 之间,如下所示:
配置区域和显示区域 1 现在应包含在具有 Align := alTop 的 TPanel 内,并且配置区域或显示区域 1 应与 alClient 对齐。
希望这有帮助
I also had the same problem in the past. TSplitter should be placed between two TPanel, like such:
Config Area and Display Area 1 should now be contained inside a TPanel with Align := alTop and either the Config Area or the Display Area 1 should be aligned to alClient.
Hope this helps