开发者

Delphi: align and visibility of splitter

开发者 https://www.devze.com 2023-03-22 15:28 出处:网络
There is a tree view, an align is left. And there is a splitter, the same, an align is left. The tree view is the first, the slitter is the second.

There is a tree view, an align is left. And there is a splitter, the same, an align is left. The tree view is the first, the slitter is the second.

If to do:

TreeView1.Visible:=false;
Splitter1.Visible:=false;

And then:

TreeView1.Visible:=true;
Splitter1.Visible开发者_StackOverflow:=true;

The splitter will be the first from the left. Must be the second. How to prevent this?

Thanks!!!


AFAIK there is no way to prevent this happening (even when you change the order of making them visible again, sometimes they still end up in wrong way). Add

Splitter1.Left := Treeview1.Left + Treeview1.Width;

after making them visible again, this should move splitter back into right position.


To make splitter second from the left you must make sure that TreeView is first on the left by setting:

TreeView1.Visible := True;
Splitter1.Visible := True;
Treeview1.Left := 0;
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号