Visibility.Collapsed 和 Visibility.Hidden 之间的区别 [英] Difference between Visibility.Collapsed and Visibility.Hidden

查看:51
本文介绍了Visibility.Collapsed 和 Visibility.Hidden 之间的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

WPF 中的 Visibility.CollapsedVisibility.Hidden 有什么区别?

What are differences between Visibility.Collapsed and Visibility.Hidden in WPF?

推荐答案

区别在于 Visibility.Hidden 隐藏控件,但保留它在布局中占用的空间.所以它呈现空白而不是控件.Visibilty.Collapsed 不呈现控件并且不保留空白.控件占用的空间是折叠的",因此得名.

The difference is that Visibility.Hidden hides the control, but reserves the space it occupies in the layout. So it renders whitespace instead of the control. Visibilty.Collapsed does not render the control and does not reserve the whitespace. The space the control would take is 'collapsed', hence the name.

来自 MSDN 的确切文本:

The exact text from the MSDN:

折叠:不显示该元素,也不在布局中为其预留空间.

Collapsed: Do not display the element, and do not reserve space for it in layout.

隐藏:不显示元素,但在布局中为元素保留空间.

Hidden: Do not display the element, but reserve space for the element in layout.

可见:显示元素.

请参阅:http://msdn.microsoft.com/en-us/library/system.windows.visibility.aspx

这篇关于Visibility.Collapsed 和 Visibility.Hidden 之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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