问题
I was just trying to create a window with Status bar and I am not able to see the status bar with as simple code as below. Could anyone tell me what could be the cause? or is it happening only in machine! I restarted VS and also my machine. I am using VS2013 Express edition
<Window x:Class="TemplateBindingSample.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="350" Width="525">
<DockPanel>
<StatusBar DockPanel.Dock="Bottom">
</StatusBar>
<Label>StatusBar Example</Label>
</DockPanel>
回答1:
You declared the Label outside of StatusBar. A statusbar without Child cannot be seen, since the ActualHeight would be 0. To solve the problem, put the Label inside the StatusBar.
<DockPanel>
<StatusBar DockPanel.Dock="Bottom">
<Label>StatusBar Example</Label>
</StatusBar>
</DockPanel>
回答2:
The StatusBar in your sample is empty and therefore has no height.
If you insert some content it should be displayed. For example:
<DockPanel>
<StatusBar DockPanel.Dock="Bottom">
<Label>Status Bar Text</Label>
</StatusBar>
<Label>StatusBar Example</Label>
</DockPanel>
来源:https://stackoverflow.com/questions/27351007/unable-to-see-status-bar