What are differences between Visibility.Collapsed and Visibility.Hidden in WPF?
Visibility.Collapsed
Visibility.Hidden
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.
Visibilty.Collapsed
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. Visible: Display the element.
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.
Visible: Display the element.
See: http://msdn.microsoft.com/en-us/library/system.windows.visibility.aspx
2.1m questions
2.1m answers
60 comments
57.0k users