如何以特定方式安排控件 [英] How to arrange controls in a specific way

查看:58
本文介绍了如何以特定方式安排控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我有一个窗口,其中有两行控件.第二行单击第一行中的控件.

I have a window in which i have two rows of controls. The second row comes on click of a control in first row.

这是应该发生的情况-

1)当窗口最大化并且第二行可见时.两行都应完整显示.即使有足够的空间容纳第二行,第二行的控制也不应该放在第一行.

1) When window is maximized and second row is visible. Both rows should display intact. Control of second row should not go in first row even if there is space to accommodate a few.

2)当窗口最小化时,由于两行都没有元素被截断,因此第一行应在下一行中包装一些元素,而第二行的少量元素(根据可用空间)应在最后控制之后进行包装第一行.

2) When window is minimized a bit and so since both rows few elements are truncating so first rows should wrap few elements in next line and second row's few element(as per the space available) should wrap in after the last control of first row.

为此,我们只需要使用xaml.

We need to use only xaml for this.

预先感谢

推荐答案

WPF中的每个控件都有一个visible属性,该属性采用一个Visibility枚举值,例如Visibility.Visible等.将行控件放入堆栈面板,并在程序需要时使堆栈面板可见.

Each control in WPF has a visible property which takes a Visibility enum value such as Visibility.Visible etc.  Put the row controls into a stack panel and make the stack panel visible when your program requires it.

MyStackPanel.Visibility = Visibility.Visable; 等等.

MyStackPanel.Visibility=Visibility.Visable;  etc.


这篇关于如何以特定方式安排控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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