2012-10-23 58 views
2

下面是一個非常簡單的WPF窗口的XAML代碼:使得SizeToContent拿冠軍到

<Window x:Class="TitleTester.MainWindow" 
     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
     Title="Long, verbose, unabridged title" SizeToContent="WidthAndHeight"> 
    <Grid> 
     <Label>Short text</Label> 
    </Grid> 
</Window> 

當我打開這個窗口,文本Short text完全顯示;但是,標題欄僅顯示L...Long, verbose, unabridged title的第一個字母)。我希望打開的窗口足夠寬以顯示完整的標題,並且不會更寬。有沒有辦法做到這一點?

回答