Here's the XAML code for a very simple WPF window:

<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>

When I open this window, the text Short text is displayed in full; however, the title bar only displays L... (the first letter of Long, verbose, unabridged title). I would like the opened window to be wide enough to display the full title, and no wider. Is there a way to do this?

有帮助吗?

解决方案

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top