看不到状态栏 [英] Unable to see status bar
本文介绍了看不到状态栏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我只是想创建一个带有状态栏的窗口,但我无法使用如下简单的代码看到状态栏.谁能告诉我可能是什么原因?还是只发生在机器上!我重新启动了 VS 和我的机器.我使用的是 VS2013 Express 版
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>
推荐答案
您在 StatusBar 之外声明了 Label.没有 Child 的状态栏是看不到的,因为 ActualHeight 会是 0.为了解决这个问题,把 Label 放在 StatusBar 里面.
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>
这篇关于看不到状态栏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文