[英]Unable to see status bar
我只是試圖用“狀態欄”創建一個窗口,而無法使用以下簡單代碼查看狀態欄。 誰能告訴我原因是什么? 還是僅在機器中發生! 我重新啟動了VS以及我的機器。 我正在使用VS2013 Express版
<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為空,因此沒有高度。
如果插入一些內容,則應顯示。 例如:
<DockPanel>
<StatusBar DockPanel.Dock="Bottom">
<Label>Status Bar Text</Label>
</StatusBar>
<Label>StatusBar Example</Label>
</DockPanel>
您在StatusBar之外聲明了Label。 不能看到沒有Child的狀態欄,因為ActualHeight為0。要解決此問題,請將Label放在StatusBar內。
<DockPanel>
<StatusBar DockPanel.Dock="Bottom">
<Label>StatusBar Example</Label>
</StatusBar>
</DockPanel>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.