编辑后保留突出显示的文本颜色(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.
相关问答
更多-
TextSocketSource不提供任何集成的解析选项。 只能使用以下两种格式之一: 时间戳和文本,如果includeTimestamp设置为true ,则使用以下模式: StructType([ StructField("value", StringType()), StructField("timestamp", TimestampType()) ]) 仅当includeTimestamp设置为false且模式如下所示时才includeTimestamp文本: StructType( ...
-
我会使用https://github.com/yaronn/blessed-contrib它带有很多内置的小部件。 I would use https://github.com/yaronn/blessed-contrib it comes with a lot of widgets built-in.
-
如果你想在左边有按钮并在右边画图,我想你应该把你的页面分成两部分。 像这样的东西: tabItem(tabName = "Sales_Performance", fluidRow(title= "Sales Breakdown",width = 500, column(4, sliderInput("monthInput","Month",min=1,max = 12,step = 1,c(25,45)), ...
-
要在用户的仪表板页面中显示用户的通知,请按照Widget构造中的以下代码进行操作。 $this->service = NOTIFICATIONS_BOL_Service::getInstance(); $userid = OW::getUser()->getId(); $allNotificationCount = $this->service->findNotificationCount($userid); // Get the notifications of currently logged in ...
-
通过API在New Relic仪表板上显示图表(Displaying the charts from the New Relic dashboard over the API)[2022-08-31]
将鼠标悬停在New Relic Dashboard中的图表上时,该图表的右下角会出现“+”。 您可以单击“+”然后选择“嵌入”以创建html可嵌入链接。 只要您在创建图表时将时间范围设置为“立即结束”,图表就会在您嵌入图表的任何页面上主动更新。 When you hover over a chart in the New Relic Dashboard, a "+" will appear in the lower right corner of that chart. You can click that ... -
现在没关系,因为我自己就是这样做的,就像这样: add_action( 'show_user_profile', 'display_user_custom_hash' ); add_action( 'edit_user_profile', 'display_user_custom_hash' ); function display_user_custom_hash( $user ) { ?>
USERMETA Fields