WPF GroupBox可见性 [英] WPF GroupBox visibility

查看:608
本文介绍了WPF GroupBox可见性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在研究WPF桌面应用程序。 MainWindow是一个最大化的窗口,其菜单包含很少的菜单项。我想在窗口中心的组框中显示几个控件。此组框包含控件,具体取决于单击的菜单项。因此,groupbox的大小不应该是静态的。这可能吗?



谢谢

I'm working on a WPF desktop application. The MainWindow is a maximized window that has a menu with few menu items. I would like to display few controls within a groupbox on the center of the window. This groupbox contains controls depending on the menu item clicked. So the size of the groupbox should not be static. Is this possible?

Thanks

推荐答案

不要设置大小,只需设置

Don't set a size, just set
VerticalAlignment="Center" HorizontalAlignment="Center"

用于组合框。组框将根据其内容调整大小

for the groupbox. The groupbox will adjust size depending its content


这篇关于WPF GroupBox可见性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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