How to use custom color

In my wpf application, I want to use this custom color code # 7EC143 for the background of my button .... need help setting a custom color code for the background of the button

+4
source share
2 answers
<Button Background="#7EC143" /> 
+7
source

In your XAML, just install it like this:

 <Button Name="button1" Background="#7EC143">Foo</Button> 

If you are trying to do this from code, it looks like this:

 button1.Background = new SolidColorBrush(Color.FromArgb(0xff, 0x7e, 0xc1, 0x43)); 
+7
source

All Articles