编辑后保留突出显示的文本颜色(Retain highlighted color of text after editing)
在删除前面的行内容后,无法保留我在我的文本上设置的RichTextBox中突出显示的效果。
无论我从控件中删除多少文本,它总是删除自定义SelectionColor和SelectionBackColor我设置为已包含在其中的文本。
我的删除方法代码:
private void btnRemove_Click(object sender, EventArgs e) { //Remove selected line from RichTextBox richTextBox1.Text = richTextBox1.Text.Remove(richTextBox1.Text.Length - 1, 1); //Remove all blank lines remaining after deletion richTextBox1.Text = Regex.Replace(richTextBox1.Text, @"^\s*$(\n|\r|\r\n)", "", RegexOptions.Multiline); }
我想在这里删除的字母数是1,因为单词“AND”是通过剪贴板粘贴方法插入的简单图像。
Cannot keep the highlighted effect I set in my RichTextBox on my text after removing content of a line in front of him.
No matter how much text I remove from the control it always removes the custom SelectionColor and SelectionBackColor I set to a text already contained in it.
Code of my Removal method:
private void btnRemove_Click(object sender, EventArgs e) { //Remove selected line from RichTextBox richTextBox1.Text = richTextBox1.Text.Remove(richTextBox1.Text.Length - 1, 1); //Remove all blank lines remaining after deletion richTextBox1.Text = Regex.Replace(richTextBox1.Text, @"^\s*$(\n|\r|\r\n)", "", RegexOptions.Multiline); }
The number of letters I want to remove here is 1 as the word "AND" is a simple image inserted by means of Clipboard Paste method.
原文:https://stackoverflow.com/questions/37064223
满意答案
我会使用https://github.com/yaronn/blessed-contrib它带有很多内置的小部件。
I would use https://github.com/yaronn/blessed-contrib it comes with a lot of widgets built-in.
相关问答
更多使用套接字激发流,在控制台中设置SCHEMA,显示DATAFRAME(Spark Structured Streaming using sockets, set SCHEMA, Display DATAFRAME in console)
NodeJs如何在控制台中显示表结构化仪表板(NodeJs how to display table structured dashboard in console)
仪表板显示问题/布局/绘图/反应/ UI(Dashboard display issues / layout / plot / reactive / UI)
在oxwall的用户仪表板中显示用户通知(Display user notifications in User dashboard in oxwall)
通过API在New Relic仪表板上显示图表(Displaying the charts from the New Relic dashboard over the API)
Wordpress在User Profile仪表板上显示自定义USERMETA字段?(Wordpress to display custom USERMETA field on User Profile Dashboard?)
如何在树视图中显示分层结构化的数据库?(how to display an hierarchical structured database in tree view?)
如何在CloudKit仪表板中使用“fetchWithRecordID”自动生成ID?(How to use “fetchWithRecordID” for automatically generated ID in CloudKit Dashboard?)
如何在sonarqube仪表板上显示指标值?(How to display metric value on sonarqube dashboard?)
如何在wso2 das中查看哪个分析表绑定到仪表板(How to see which analytic table is bound to the dashboard in wso2 das)
相关文章
更多网络挖掘技术——text mining
Full-Text Search in ASP.NET using Lucene.NET
Solr官方文档系列——Text Analysis
jquery 怎么得到link中text的属性
企业级搜索引擎Solr 第二章 Schema和文本分析(Schema and Text Analysis)[2]
java.text.DecimalFormat 的问题
Django and full-text search
用‘button’跟‘text’组合代替‘file’,选择文件后点‘submit’,‘file’的值被清空
java double 保留两位小数
最新问答
更多获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
如何通过引用返回对象?(How is returning an object by reference possible?)
矩阵如何存储在内存中?(How are matrices stored in memory?)
每个请求的Java新会话?(Java New Session For Each Request?)
css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
xcode语法颜色编码解释?(xcode syntax color coding explained?)
在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
Copyright ©2023 peixunduo.com All Rights Reserved.粤ICP备14003112号
本站部分内容来源于互联网,仅供学习和参考使用,请莫用于商业用途。如有侵犯你的版权,请联系我们(neng862121861#163.com),本站将尽快处理。谢谢合作!