可选的TextBlock或在WPF格式化文本一个TextBox [英] Selectable TextBlock or a TextBox with formatted text in WPF

查看:1196
本文介绍了可选的TextBlock或在WPF格式化文本一个TextBox的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个情况我需要显示一个格式化的文本(正常,粗体,高亮显示),还应该进行选择,这样用户可以复制的文本。

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?

推荐答案

我不知道有多少风格你想申请,但我发现下面的网站是确定使用Silverlight的最好方法有用的控制:
http://samples.msdn.microsoft.com/Silverlight/SampleBrowser/index.htm#/

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#/

这特定的URL对如何风格文本框的一些信息:
http://samples.msdn.microsoft.com/Silverlight/SampleBrowser/index.htm#/?sref=TextBoxSnippet

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

这篇关于可选的TextBlock或在WPF格式化文本一个TextBox的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆