If you want to set translucent background in encoding, you can do it
use dependency support over a class that inherits from TextBox
public static readonly DependencyProperty BgColourProperty = DependencyProperty.Register("BgColour", typeof(SolidColorBrush), typeof(myTextBox), null); public SolidColorBrush BgColour { get { return (SolidColorBrush)GetValue(BgColourProperty); } set { SetValue(BgColourProperty, value); } }
then set whatever color you want using Color.FromArgb (), where the 1st argument is an Alpha component
myTextBox.BgColour = new SolidColorBrush(Color.FromArgb(120,240, 17, 17));
source share