Guest User

Untitled

a guest
Aug 18th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. How to change the border color of a flat button style
  2. <Style TargetType="Button" x:Key="FlatButtonStyle">
  3. <Setter Property="Background" Value="Transparent" />
  4. <Setter Property="BorderBrush" Value="Transparent" />
  5. <Setter Property="Margin" Value="2" />
  6. <Setter Property="FontSize" Value="30" />
  7. <Style.Triggers>
  8. <Trigger Property="IsFocused" Value="true">
  9. <Setter Property="BorderBrush" Value="#E01919"/>
  10. </Trigger>
  11. </Style.Triggers>
  12. </Style>
  13.  
  14. <UserControl.Resources>
  15. <Style x:Key="Flat">
  16. <Setter Property="Control.BorderBrush" Value="{x:Null}" />
  17. <Style.Triggers>
  18. <Trigger Property="Control.IsMouseOver" Value="True">
  19. <Setter Property="Control.BorderBrush" Value="{x:Null}" />
  20. </Trigger>
  21. </Style.Triggers>
  22. </Style>
  23. </UserControl.Resources>
  24. <StackPanel>
  25. <Button Style="{StaticResource Flat}">Hello</Button>
  26. </StackPanel>
Add Comment
Please, Sign In to add comment