2019-11-7-WPF-How-to-get-plain-text-from-RichTextBox
title | author | date | CreateTime | categories |
---|---|---|---|---|
WPF How to get plain text from RichTextBox
|
lindexi
|
2019-11-07 10:26:17 +0800
|
2019-11-07 10:26:16 +0800
|
WPF
|
We can not find any function to get plain text from RichTextBox. But we can use TextRange to get plain text.
We create a RichTextBox in UI
<RichTextBox Name="RichTextBox">
<FlowDocument>
<Paragraph>
<Run>Paragraph 1</Run>
</Paragraph>
<Paragraph>
<Run>Paragraph 2</Run>
</Paragraph>
<Paragraph>
<Run>Paragraph 3</Run>
</Paragraph>
</FlowDocument>
</RichTextBox>
And we can use TextRange to get plain text from RichTextBox
string text = new TextRange(RichTextBox.Document.ContentStart, RichTextBox.Document.ContentEnd).Text
2019-11-7-WPF-How-to-get-plain-text-from-RichTextBox的更多相关文章
- EOJ Monthly 2019.11 E. 数学题(莫比乌斯反演+杜教筛+拉格朗日插值)
传送门 题意: 统计\(k\)元组个数\((a_1,a_2,\cdots,a_n),1\leq a_i\leq n\)使得\(gcd(a_1,a_2,\cdots,a_k,n)=1\). 定义\(f( ...
- [New!!!]欢迎大佬光临本蒟蒻的博客(2019.11.27更新)
更新于2019.12.22 本蒟蒻在博客园安家啦!!! 本蒟蒻的博客园主页 为更好管理博客,本蒟蒻从今天开始,正式转入博客园. 因为一些原因,我的CSDN博客将彻底不会使用!!!(带来不便,敬请谅解) ...
- 2019.11.9 csp-s 考前模拟
2019.11.9 csp-s 考前模拟 是自闭少女lz /lb(泪奔 T1 我可能(呸,一定是唯一一个把这个题写炸了的人 题外话: 我可能是一个面向数据编程选手 作为一个唯一一个写炸T1的人,成功通 ...
- 如何撤销 PhpStorm/Clion 等 JetBrains 产品的 “Mark as Plain Text” 操作 ?
当把某个文件“Mark as Plain Text”时,该文件被当做普通文本,就不会有“代码自动完成提示”功能,如下图所示: 但是呢,右键菜单中貌似没有 相应的撤销 操作, 即使是把它删除,再新建一个 ...
- Jade之Plain Text
Plain Text jade提供了3种得到纯文本的方法. Piped Text 添加纯文本的一个最简单的方法就是在文本最前面加|符号即可. jade: p | It must always be o ...
- Insert Plain Text and Images into RichTextBox at Runtime
Insert Plain Text and Images into RichTextBox at Runtime' https://www.codeproject.com/Articles/4544/ ...
- [Regular Expressions] Find Plain Text Patterns
The simplest use of Regular Expressions is to find a plain text pattern. In this lesson we'll look a ...
- How to return plain text from AWS Lambda & API Gateway
With limited experience in AWS Lambda & API Gateway, it's struggling to find the correct way to ...
- Plain text considered harmful: A cross-domain exploit
referer:http://balpha.de/2013/02/plain-text-considered-harmful-a-cross-domain-exploit/ Data from aro ...
- .NET Core/.NET5/.NET6 开源项目汇总11:WPF组件库1
系列目录 [已更新最新开发文章,点击查看详细] WPF(Windows Presentation Foundation)是微软推出的基于Windows 的用户界面框架,属于.NET Frame ...
随机推荐
- mysql的锁
前言 mysql锁的概念参考如下连接: 1.http://blog.csdn.net/u013063153/article/details/53432468 2.http://www.yesky.co ...
- 【LeetCode】从contest-21开始。(一般是10个contest写一篇文章)
[LeetCode Weekly Contest 29][2017/04/23] 第17周 Binary Tree Tilt (3) Array Partition I (6) Longest Lin ...
- nuxtJs - axios 的 IE 兼容性的问题
因为考虑SEO, 所以采用nuxt.js进行服务端渲染, 用熟了vue, nuxt无缝对接简直不要太爽 烦人的需求又来了, 要兼容IE ~~ 兼容处理 无非就是babel 将高级语法转成弱智IE看得懂 ...
- MySQL中常见函数
一.日期函数 1.NOW() 返回当前日期和时间 mysql> SELECT NOW(); +---------------------+ | NOW() | +-------------- ...
- 2.xml约束技术----------dtd约束
1.xml的约束 (1)为什么需要定义约束了 比如现在定义一个person的xml文件,只想要这个文件里面保存人的信息,比如name age等,但是如果在xml文件中写了一个元素<猫>,发 ...
- The main Method
The main Method You can call static methods without having any objects. For example, you never const ...
- Android SDK的下载与安装*(PC版)
Android SDK的下载与安装 一.Android SDK简介下载地址:https://www.androiddevtools.cn/ 将下载后的安装包解压到相应的目录下,如下图: 三.安装A ...
- 偏函数(partial)
from functools import partial def add(a,b,c,d): return a+b+c+d add = partial(add,1,2) print(add(3,4) ...
- HDU 6055 Regular polygon —— 2017 Multi-University Training 2
Regular polygon Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)T ...
- C#_winform登陆框验证码的实现
验证码技术已愈来愈成熟,从最初的数字.字母.字符.汉字已经到目前的语言,其应用也甚广,之前大多数只有在网站上可以看到,现在在一些客户端软件也经常可见(比如证券相关软件).之前做的一个基于 C# 客户端 ...