Advertisement
KatarzynaBracha

style 2 wpf

Nov 18th, 2021
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. <Grid>
  2. <WrapPanel>
  3. <WrapPanel.Resources>
  4. <Style x:Key="stylElementow">
  5. <Setter Property="Control.Margin" Value="10"/>
  6. <Setter Property="Control.Padding" Value="10"/>
  7. <Setter Property="Control.FontSize" Value="12"/>
  8. <Setter Property="Control.FontWeight" Value="Bold"/>
  9. <Setter Property="Control.FontStyle" Value="Italic"/>
  10. <Setter Property="Control.BorderBrush" Value="Black"/>
  11. <Setter Property="Control.BorderThickness" Value="2"/>
  12. <Setter Property="Control.Background">
  13. <Setter.Value>
  14. <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
  15. <GradientStop Color="White" Offset="0"/>
  16. <GradientStop Color="Gray" Offset="1"/>
  17. </LinearGradientBrush>
  18. </Setter.Value>
  19. </Setter>
  20. </Style>
  21. </WrapPanel.Resources>
  22. <Button Content="Przycisk" Style="{StaticResource stylElementow}"/>
  23. <TextBox Text="Pole tekstowe" Style="{StaticResource stylElementow}"/>
  24. <TextBlock Text="TextBlock. A tu nie ma tła zdefiniowanego w stylu"
  25. Style="{StaticResource stylElementow}"/>
  26. </WrapPanel>
  27. </Grid>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement