In in WPF controls, which ones are similar to `<div>` HTML tag? In in WPF controls, which ones are similar to `<div>` HTML tag? wpf wpf

In in WPF controls, which ones are similar to `<div>` HTML tag?


StackPanel, DockPanel, WrapPanel are mainly used for design, to align the controls in a specific way. Therefor i would use the Grid.

All of these can be used, but using a Panel just for hide and seek would make it lose its meaning.


Use StackPanel or other kinds of panels depending on your need (WrapPanel if you need wrapping).


Any of the panels - Grid, stackpanel, canvas, etc - in WPF can be Visible/Collapsed/Hidden. Just set the visibility of the object to Visibility.Hidden or Visibility.Collapsed. Notice the Name="" attribute...

<StackPanel Name="Test" Visibility="Visible">       ...  </StackPanel>  

On the code-behind, do a simple Name.Visibility conversion:

Test.Visibility = Visibility.Visible;Test.Visibility = Visibility.Collapsed;Test.Visibility = Visibility.Hidden;

It's also worth noting that most (if not all?) objects have Visibility. Buttons, menu items, etc, etc... Button Name="MyButton, Mybutton.Visibility =...

Edit: Link I posted wasn't helpful.