I've got a WPF TextBox into which my users type XHTML.
XAML...
<TextBox Name="TextBoxContentBody" TextWrapping="Wrap" AcceptsReturn="True" VerticalScrollBarVisibility="Visible" FontFamily="Consolas" ... />
It looks like this:
I'd rather that it looked like this (Photoshopped mock-up):
How might I accomplish this?
You can use the following code to achieve your purpose: textBoxToHighlight. Focus(); textBoxToHighlight. Select(0, textBoxToHighlight.
The TextBox class enables you to display or edit unformatted text. A common use of a TextBox is editing unformatted text in a form. For example, a form asking for the user's name, phone number, etc would use TextBox controls for text input.
You'll want to use a RichTextBox for that.
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