Donate

WPF How To Set Color Value Using Hexademical Value

Here's a snippet that passes a hexa color and set a wpf control object's background/foreground property.
BrushConverter bc = new BrushConverter();   
Brush brush;   
brush = (Brush)bc.ConvertFrom("#003F87");   
notes.SetValue(TextBlock.BackgroundProperty, brush);
Original Source: http://jammer.biz/blog2/?p=169
Greg

Comments

Donate

Popular Posts From This Blog

WPF CRUD Application Using DataGrid, MVVM Pattern, Entity Framework, And C#.NET

How To Insert Or Add Emojis In Microsoft Teams Status Message

TypeScript Error Or Bug: The term 'tsc' is not recognized as the name of a cmdlet, function, script file, or operable program.