How do I create a Text Box which Blends into the background page, the idea here is i want to create NoteBook like Effect with lines and user types on lines ( just like writing in Notebook with lines).
Take a TextBox
with transparent background, put it on top of your notebook paper image and align font size so it looks as desired. You may want to wrap TextBox
with ViewBox
<TextBox TextWrapping="Wrap" Background="{x:Null}"/>
Or use a TextBox
with notebook paper image as background:
<TextBox TextWrapping="Wrap">
<TextBox.Background>
<ImageBrush ImageSource="notebook-paper.png"/>
</TextBox.Background>
</TextBox>
Style your TextBox
as required so that the background shows through. To remove the Textbox's background, padding, border, etc., use:
<TextBox Margin="0" BorderThickness="0" Padding="0" Background="Transparent" />
To control the line height so that it lines up neatly on your notepad line graphic, use the TextBlock
attached properties:
<TextBox
Margin="0" BorderThickness="0" Padding="0" Background="Transparent"
TextBlock.LineHeight="10"
TextBlock.LineStackingStrategy="BlockLineHeight" />
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