开发者

WPFToolkit.Extended RichTextBox run time format [closed]

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);
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜