开发者

Selectable TextBlock or a TextBox with formatted text in WPF

I have a situation where I need to show a formatted text (normal, bold, highlighted) and should also be selectable so that user can copy the text.

I have 开发者_运维百科used textblock where i can apply multiple formattings using Inline content flow elements but unfortunately it's text is not selectable.

Whereas Textbox allows to select text and copy to clipboard, it does not allow me to format text.

Is there anything I am missing or I'll have to build a custom control?


I'm not sure how much style you're wanting to apply, but I find the following site to be useful to determine the best way to use Silverlight controls: http://samples.msdn.microsoft.com/Silverlight/SampleBrowser/index.htm#/

This specific URL has some information on how to style a Textbox: http://samples.msdn.microsoft.com/Silverlight/SampleBrowser/index.htm#/?sref=TextBoxSnippet


You can use RichTextBox. It control is selectable and support formatted tex.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜