Hello Team,
Background colour not changing in wpf help me
- <Window x:Class="WpfResources.MainWindow"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:local="clr-namespace:WpfResources"
- mc:Ignorable="d"
- Title="MainWindow" Height="450" Width="800">
- <Window.Resources>
- <SolidColorBrush Color="Red" x:Key="ButtonColorRed">SolidColorBrush>
- Window.Resources>
- <Grid>
- <Button Width="200" Height="100" Margin="47,68,553,266" Background="{StaticResource ButtonColorRed}" >Button>
- <Button Width="200" Height="100" Margin="332,90,268,244" Background="{StaticResource ButtonColorRed}" >
- <Button.Style>
- <Style TargetType="Button">
- <Setter Property="Background" Value="Blue">
- Setter>
- Style>
- Button.Style>
- Button>
- Grid>
- Window>
Meghana.
Rajanikant HawaldarPosted Nov 3, 2020, 2:39 AM
Meghana BPosted Nov 3, 2020, 2:40 AM