Change button border thickness in wpf?

前端 未结 1 1392
忘了有多久
忘了有多久 2021-01-21 06:23

Why the border thickness of the Button doesn\'t change?

If I change the border thickness to 1 or 100, it doesn\'t matters. It\'s the same. I would like to change it usin

相关标签:
1条回答
  • 2021-01-21 06:59

    You can do it by changing the Button's ControlTemplate. Copy those style, brushes and ... to you resource dictionary then change the values you want.

    To change the border thickness find the following code and make changes you want:

    ...
    <Border 
          x:Name="Border"  
          CornerRadius="2" 
          BorderThickness="1"                             //CHANGE THIS VALUE
          Background="{StaticResource NormalBrush}"
          BorderBrush="{StaticResource NormalBorderBrush}">
          <ContentPresenter 
            Margin="2"
            HorizontalAlignment="Center"
            VerticalAlignment="Center"
            RecognizesAccessKey="True"/>
    </Border>
    ...
    
    0 讨论(0)
提交回复
热议问题