It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical andcannot be reasonabl开发者_JS百科y answered in its current form. F
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonabl开发者_JS百科y answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
I required to format text in RichTextBox at runtime, i.e. make selected text bold at runtime.
You can use the ApplyPropertyValue() method:
TextSelection selection = yourRichTextBox.Selection;
if (!selection.IsEmpty) {
selection.ApplyPropertyValue(TextElement.FontWeightProperty,
FontWeights.Bold);
}
精彩评论