我是新來WPF。我的要求是做一個圓角矩形的啓動畫面。我做了一些搜索並實現了圓形矩形。但問題在於它失敗了一些領域。請看截圖並查看下面的代碼。 邊框不是覆蓋整個區域
中的圖像,你可以看到黑色邊框拐角處
打破這是我的XAML
<Window x:Class="TimeLogger.StartWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Width="470" Height="270" ShowInTaskbar="False" WindowStartupLocation="CenterScreen"
ResizeMode="NoResize" WindowStyle="None" AllowsTransparency="True" Background="Transparent" >
<Border BorderBrush="#FF000000" BorderThickness="2,2,2,2" CornerRadius="8,8,8,8">
<Grid Background="#012a7a" >
<Label Margin="-5,-7,5,7">
<TextBlock Foreground="Black" FontFamily="Segoe UI" FontSize="25" FontStretch="UltraExpanded" Height="71" Width="177">
TimeLogger
</TextBlock>
</Label>
</Grid>
</Border>
</Window>
爲什麼你把一個文本塊,在一個標籤? –
@eranotzap。我需要在標籤中顯示一些文本,我需要實現相當於「 –
kbvishnu
–