开发者

WPFToolkit.Extended RichTextBox run time format [closed]

开发者 https://www.devze.com 2023-03-13 11:00 出处:网络
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);
}
0

精彩评论

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