richtextbox

RichTextBox flickers while coloring words

允我心安 提交于 2021-02-19 05:25:10
问题 I have a RichTextBox. lets say I want to draw every word "test" in the text. My problem is not to find the "test" in the text, My problem is when I color the word I can see the RichTextBox Selection process. My color function: Private Sub DrawSubPart(ByVal StartIndex As Integer, ByVal EndIndex As Integer, ByVal col As Color) Dim save As Integer = TextScreen.SelectionStart TextScreen.SelectionStart = StartIndex 'Here I can see the selection, And I dont want to see it. TextScreen

Get/Set First Visible Line of RichTextBox

微笑、不失礼 提交于 2021-02-18 10:45:31
问题 I have a RichTextBox with thousands of lines of text in it. I can easily SET the first visible line by using ScrollToCaret() by doing... this.SelectionStart = this.Find(this.Lines[lineIndex], RichTextBoxFinds.NoHighlight); this.ScrollToCaret(); But I would like to be able to GET the first visible line too. Any suggestions? 回答1: Here may be what you need: //get the first visible char index int firstVisibleChar = richTextBox1.GetCharIndexFromPosition(new Point(0,0)); //get the line index from

Hyperlinks without underline in RichTextBox on Windows 10 1803

倖福魔咒の 提交于 2021-02-18 10:21:08
问题 I'm displaying RTF document in RichTextBox ("upgraded" to RichEdit50W ). Keywords in the document are linked to a webpage using a syntax: {\field{\*\fldinst{HYPERLINK ""https://www.example.com/"" }}{\fldrslt{\cf1 keyword\cf0 }}} I do not want to underline the keywords. Until Windows 10 version 1803 (and in all previous versions of Windows, including XP, Vista, 8), whenever a color was set on the anchor (note the \cf1 ), the anchor was not underlined. But this no longer works in Windows 10

How to change part of text color at RichTextBox

让人想犯罪 __ 提交于 2021-02-10 12:45:33
问题 Good day! I try to change part of text to red color. So, i try to use TextBox, but it not works. So, i read, that RichTextBox can do that:i use this question But i do not know how to append colored text? TextRange rangeOfText1 = new TextRange(tbScriptCode.Document.ContentEnd, tbScriptCode.Document.ContentEnd); rangeOfText1.Text = "Text1 "; rangeOfText1.ApplyPropertyValue(TextElement.ForegroundProperty, Brushes.Blue); rangeOfText1.ApplyPropertyValue(TextElement.FontWeightProperty, FontWeights

How do I override Ctrl+Shift+0 (zero) for WinForms RichTextBox?

一曲冷凌霜 提交于 2021-02-10 12:13:45
问题 For my subclassed RichTextBox class, I can capture, suppress the default behaviour of and re-purpose Ctrl+Shift+#, as long as # is between 1 and 9. For Ctrl+Shift+0, I can't. I have experimented with ProcessCmdKey in the form class and onKeyDown and PreProcessMessage in the control class. Here is sample code meant for the control class that should suppress Ctrl+Shift+0 but does not: public override bool PreProcessMessage(ref Message msg) { bool cancel = false; int vKeyCode = (int)msg.WParam;

How do I override Ctrl+Shift+0 (zero) for WinForms RichTextBox?

一世执手 提交于 2021-02-10 12:13:12
问题 For my subclassed RichTextBox class, I can capture, suppress the default behaviour of and re-purpose Ctrl+Shift+#, as long as # is between 1 and 9. For Ctrl+Shift+0, I can't. I have experimented with ProcessCmdKey in the form class and onKeyDown and PreProcessMessage in the control class. Here is sample code meant for the control class that should suppress Ctrl+Shift+0 but does not: public override bool PreProcessMessage(ref Message msg) { bool cancel = false; int vKeyCode = (int)msg.WParam;

How do I override Ctrl+Shift+0 (zero) for WinForms RichTextBox?

穿精又带淫゛_ 提交于 2021-02-10 12:13:08
问题 For my subclassed RichTextBox class, I can capture, suppress the default behaviour of and re-purpose Ctrl+Shift+#, as long as # is between 1 and 9. For Ctrl+Shift+0, I can't. I have experimented with ProcessCmdKey in the form class and onKeyDown and PreProcessMessage in the control class. Here is sample code meant for the control class that should suppress Ctrl+Shift+0 but does not: public override bool PreProcessMessage(ref Message msg) { bool cancel = false; int vKeyCode = (int)msg.WParam;

Cursor flickers when trying to resize image in RichTextBox

时光怂恿深爱的人放手 提交于 2021-02-07 08:30:03
问题 I hope this is a simple question. I do the following: In VS2010, I create a Windows Form Application From the Toolbox, drag RichTextBox control to the form Size the form and RichTextBox control large enough to display a small picture. Run (start debugging). Copy a small image from a web browser and paste to richtextbox (using ctrl-v). Select the image in the richtextbox. A resize frame is displayed with small boxes. Now when I position the cursor over one of the small resizer boxes, the

Cursor flickers when trying to resize image in RichTextBox

扶醉桌前 提交于 2021-02-07 08:29:57
问题 I hope this is a simple question. I do the following: In VS2010, I create a Windows Form Application From the Toolbox, drag RichTextBox control to the form Size the form and RichTextBox control large enough to display a small picture. Run (start debugging). Copy a small image from a web browser and paste to richtextbox (using ctrl-v). Select the image in the richtextbox. A resize frame is displayed with small boxes. Now when I position the cursor over one of the small resizer boxes, the

Cursor flickers when trying to resize image in RichTextBox

时光毁灭记忆、已成空白 提交于 2021-02-07 08:29:51
问题 I hope this is a simple question. I do the following: In VS2010, I create a Windows Form Application From the Toolbox, drag RichTextBox control to the form Size the form and RichTextBox control large enough to display a small picture. Run (start debugging). Copy a small image from a web browser and paste to richtextbox (using ctrl-v). Select the image in the richtextbox. A resize frame is displayed with small boxes. Now when I position the cursor over one of the small resizer boxes, the