2016-10-15 21 views
1

我剛開始使用GroupBoxes,我只是想知道爲什麼我不能讓我的角落鋒利,就好像它是一個矩形。 我見過一些在線和他們的角落不圓。這是爲什麼?我如何改變一個groupBox的角落而不是圓C#.NET WPF

<GroupBox x:Name="howTOGroupBox" BorderBrush="White" Foreground="White" Header="How To" HorizontalAlignment="Left" Margin="88,86,0,0" VerticalAlignment="Top" Height="79" Width="221" BorderThickness="1"/> 

enter image description here

回答

2

你可以風格你的GroupBox控件模板和輪0所有的角落:

<Window.Resources> 
    <Style TargetType="GroupBox"> 
     <Setter Property="Template"> 
      <Setter.Value> 
       <ControlTemplate TargetType="GroupBox"> 
        <Grid> 
         <Grid.RowDefinitions> 
          <RowDefinition Height="Auto" /> 
          <RowDefinition Height="*" /> 
         </Grid.RowDefinitions> 
         <Border Grid.Row="0" 
          BorderThickness="1" BorderBrush="White" 
          CornerRadius="0,0,0,0"> 
          <ContentPresenter 
          ContentSource="Header" 
          RecognizesAccessKey="True" /> 
         </Border> 
         <Border Grid.Row="1" BorderBrush="White" 
            BorderThickness="1" 
            CornerRadius="0,0,0,0"> 
          <ContentPresenter Margin="4" /> 
         </Border> 
        </Grid> 
       </ControlTemplate> 
      </Setter.Value> 
     </Setter> 
    </Style> 
</Window.Resources> 
+0

進出口真正的新XAML,我將如何使用,在我的代碼?我會在XAML編輯器中使用它嗎? –

+0

只要把它放在你的資源中,我會更新答案。 – Rom