I can’t get my statusbar to show in the bottom. When I dock it to the bottom shouldn’t it work this way?
<DockPanel>
<Menu DockPanel.Dock="Top">
<MenuItem Header="File">
<MenuItem Header="Open" />
<MenuItem Header="Save As" />
<MenuItem Header="Save" />
<MenuItem Header="Exit" />
</MenuItem>
</Menu>
<ToolBarPanel DockPanel.Dock="Left">
<Button>Næste</Button>
<Button>Frem</Button>
</ToolBarPanel>
<RichTextBox DockPanel.Dock="Right"></RichTextBox>
<StatusBar DockPanel.Dock="Bottom">test</StatusBar>
</DockPanel>
According to documentation the last child always fills the panel, regardless of what you set the
Dockvalue to, unless theLastChildFillproperty is set to false (default is true). So either move theStatusBarabove theRichTextBoxor set theLastChildFillproperty to false.Update:
RichTextBoxbehaves a bit strangely, it appears it always fills the dock panel in your case, even ifLastChildFillis set to false. IfRichTextBoxis replaced with another control then the behavior is as expected. I don’t know enough about WPF yet to know why this is. But if you put yourStatusBarabove theRichTextBoxeverything seems ok.