WPF,GridSplitter移动,也想控制移动 [英] WPF, GridSplitter moves, want controls to move too

查看:433
本文介绍了WPF,GridSplitter移动,也想控制移动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

希望简单的问题



我在窗口上有一个GridSplitter。我在网格分割器的右侧添加了一个控件。



我希望GridSplitter右侧的控件能够与GridSplitter一起扩展或收缩。



是否有我需要更改的设置?

Hopefully simple question

I have a GridSplitter on a Window. I added a control to the right of the grid splitter.

I want the control on the right of the GridSplitter to expand or contract with the GridSplitter.

Is there a setting I just need to change?

推荐答案

您可能需要更改锚属性以便两者都可以左侧和右侧都是锚定的。



(我应该提一下,这是你希望改变大小的控件上的锚属性)。
You probably need to change the anchor property so that both the left and right sides are anchored.

(I should mention, this is the anchor property on the control you want to have change size).


尝试使用带有网格分割器的手风琴控制器。

这样可以让你在折叠窗口时同时移动分割器。
Try using the accordion control with the grid splitter.
This should give you the effect of collapsing a window while allowing the splitter to be moved as well.


这篇关于WPF,GridSplitter移动,也想控制移动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆