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

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

Invalid nested tag div found, expected closing tag input