WPF <StatusBar> not located at the bottom of the window

We have a WPF executable that creates a and then dynamically loads multiple assemblies. Each assembly is a screen (.xaml) that appears on one of the tabs. The problem is that it is located directly under the window, not at the bottom. How to make me always be at the bottom of the window? thanks!

UserControl DockPanel CheckBox StatusBar DockPanel UserControl 
+7
wpf
source share
3 answers

In addition to ArsenMkrtโ€™s answer about including the DockPanel.Dock = "Bottom" attribute, remember that the LAST element in the DockPanel will fill the area unless you explicitly specify it using the height command (regardless of the DockPanel.).

my suggestion is as follows:

 <UserControl> <DockPanel> <StatusBar DockPanel.Dock="Bottom" /> <CheckBox /> </DockPanel> </Usercontrol> 
+12
source share

I had the same problem just now. Thanks to Stephen Wrighttonโ€™s hint that the last item added to the DockPanel fills the remaining area, I figured out how to set up my Window . It was a bit strange since I added the last Grid , but it was located in the middle.

 <Window> <DockPanel> <Menu DockPanel.Dock="Top"> <MenuItem Header="_File"> </MenuItem> </Menu> <StatusBar DockPanel.Dock="Bottom"> <StatusBarItem Content="Filler" /> </StatusBar> <Grid x:Name="rootGrid"> </Grid> </DockPanel> </Window> 
+3
source share

Have you tried

 <StatusBar DockPanel.Dock="Bottom" ... /> 
+1
source share

All Articles