I need to make a Button
for bolding selected text of a string
in TextBox
/RichTextBox
, but I don't know how to do it with code behind.
TextBox1.SelectedText = new FontStyle("Bold")
It is not working.
I need to make a Button
for bolding selected text of a string
in TextBox
/RichTextBox
, but I don't know how to do it with code behind.
TextBox1.SelectedText = new FontStyle("Bold")
It is not working.
Try this code for a rich TextBox:
RichTextBox1.Selection.ApplyPropertyValue(TextElement.FontWeightProperty, FontWeights.Bold);