Hi mindstick! How can I change the background and foreground colors of a WPF Textbox programmatically in c#? Thanks in advance
If you want to set the background using a Hex Color you could do this:
var bc = new BrushConverter();
myTextBox.Background = (Brush)bc.ConvertFrom("#FFXXXXXX");
OR
you could set up a SolidColorBrush resource in xaml, and then use findResource in codebehind
<SolidColorBrush x:Key="BrushFFXXXXXX">#FF8D8A8A</SolidColorBrush>
myTextBox.Background = (Brush)Application.Current.MainWindow.FindResource("BrushFFXXXXXX");