【发布时间】:2012-10-13 10:27:54
【问题描述】:
这是一个非常简单的 WPF 窗口的 XAML 代码:
<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 的第一个字母)。我希望打开的窗口足够宽以显示完整标题,而不是更宽。有没有办法做到这一点?
【问题讨论】:
标签: wpf xaml resize title sizetocontent