Semi-Transparent background of the Textbox is needed, and the text content should be shown as normal.
Style or Brush which can store in the Resource dictionary is good.
NOTE:
My textBox is wrapped within a ContentControl.
This similar question does not help. TextBox with a Transparent Background .
On the shortcut menu, click Format Text Box. On the Colors and Lines tab, in the Fill section, click the arrow next to Color, and then click No Color. On the Colors and Lines tab, in the Line section, click the arrow next to Color, and then click No Color. Click OK.
First, place the shape over the text box to your desired position. Then, to make the ghost transparent, simply right click on the object, go to Format Shape, under shape options go to Fill & Line, look for the Transparency sliders and simply adjust the fill and line transparency to your liking. Simple.
Select the shape or text box. On the Drawing Tools Format tab, click Text Fill > More Fill Colors. In the Colors box, either click the color you want on the Standard tab, or mix your own color on the Custom tab.
To adjust the transparency of the shape, click More Fill Colors. At the bottom of the Colors dialog box, move the Transparency slider, or enter a number in the box next to the slider. You can vary the percentage of transparency from 0% (fully opaque, the default setting) to 100% (fully transparent).
In XAML you can set Background
property to Transparent
:
<TextBox Background="Transparent" />
In code-behind you can use following code:
TextBox tb = new TextBox
{
Width = 100,
Background = Brushes.Transparent
};
If you want to set background to transparent to all TextBox
you can use following style:
<Style TargetType="TextBox">
<Setter Property="Background" Value="Transparent" />
</Style>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With