Difference between Visibility.Collapsed and Visibility.Hidden

后端 未结 3 1111
暗喜
暗喜 2020-11-29 17:03

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

3条回答
  •  野性不改
    2020-11-29 17:34

    Even though a bit old thread, for those who still looking for the differences:

    Aside from layout (space) taken in Hidden and not taken in Collapsed, there is another difference.

    If we have custom controls inside this 'Collapsed' main control, the next time we set it to Visible, it will "load" all custom controls. It will not pre-load when window is started.

    As for 'Hidden', it will load all custom controls + main control which we set as hidden when the "window" is started.

提交回复
热议问题