使用以下代码,当TextBlock文本过长,引起Button的显示位置在可见区域以外:
<Window x:Class="WpfApplication11.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="200" Width="200"> <DockPanel>
<TextBlock Text="edrftgyhjnjmkfvtygbhunjiuhibygtvhnjukiytgvfbyhnj" TextTrimming="CharacterEllipsis"/>
<Button Content="Button" Width="100" DockPanel.Dock="Right"/>
</DockPanel>
</Window>
【END】