richtextbox

what is the best way to remove words from richtextbox? [closed]

谁说我不能喝 提交于 2019-12-11 23:30:31
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . * strong text I have a richTextBox and like to search the line of sentence that starts with Hello Worlds and Contains "HERE". and end with ; semi-column than I like to delete only "HERE". . My sentence, below example is only one line of sentence, but sentence may be 2 lines long, so condition should be start

ProcessCmdKey firing twice, WinForms

放肆的年华 提交于 2019-12-11 23:02:07
问题 I'm wondering why my ProcessCmdKey fires twice, when i press the button. Here's my code: protected override bool ProcessCmdKey(ref Message msg, Keys keyData) { if (keyData == Keys.Escape) { if (this.tsComboBoxFontChoice.Focused) { this.tsComboBoxFontChoice.Text = this.startFontComboBoxText; this.richTextBox.Focus(); this.tsComboBoxFontChoice.Focus(); this.isEscClicked = true; return true; } else if (this.tsComboBoxFontSizeChoice.Focused) { this.tsComboBoxFontSizeChoice.Text = this

Save Winforms RichTextBox Data as HTML?

☆樱花仙子☆ 提交于 2019-12-11 20:01:59
问题 I have to convert an Access VBA app over to VB.NET and one of the text boxes (format set to RichText) on the VBA app accepts a straight paste from a Word document including its formatting and saves it to the Access database as HTML... The HTML is then read from the database and displayed as it was originally pasted when retrieved. The issue I have now is, I can use a web browser control to display the data properly from the database, but the RichTextBox gives an Invalid File Format error.

Hyperlink with Navigation in a Richtextbox

假如想象 提交于 2019-12-11 19:39:40
问题 How would I put a hyperlink with Navigation in a Richtextbox? Right now I have the following and it gives me this error: "XAMlParseException was unhandled" xaml <Page x:Class="SafeModeLiabilityAgreement" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" mc:Ignorable="d" d:DesignHeight="300" d

How to select a line in a RichTextBox on a mouse click?

夙愿已清 提交于 2019-12-11 18:39:59
问题 I have a read-only RichTextBox in my user interface. I want to make it so that when I click on a line of text with the mouse it selects or highlights the entire line. Just that one line that was clicked. How do you do this? 回答1: RichTextBox has all the methods you need, you just need multiple of them. First you need to map the mouse position to a character index: Private Sub RichTextBox1_MouseDown(ByVal sender As Object, ByVal e As MouseEventArgs) Dim box = DirectCast(sender, RichTextBox) Dim

Replacing values mid-string

旧巷老猫 提交于 2019-12-11 18:13:36
问题 EXPLANATION OF THE CODE BELOW: I am loading a .txt file and creating a list to store it in. The while loop stores all of the text into the list. I create 3 more lists to store different values. I use REGEX to match for numbers looking like "111.111". If it is a match in the line, group it as "X" and "Y". Add each of the grouped items to the new lists created above (the 3 of them). Use addition on the "X" and "Y" values using a TextBox input value. Output the StringBuilder values to

RichTextBox ignore formatting on paste

青春壹個敷衍的年華 提交于 2019-12-11 17:45:48
问题 I have two RichTextBoxes (input and output). If I copy text with color from output and paste into input, the color of the text gets pasted as well. Is it possible to make the input-TextBox ignore formatting upon paste? I don't want colored text in the input-TextBox. 来源: https://stackoverflow.com/questions/45760744/richtextbox-ignore-formatting-on-paste

How to limit to max 83 Chars per single line in RichTextBox

ⅰ亾dé卋堺 提交于 2019-12-11 16:12:47
问题 Im trying to make a recreation of MSWord using WPF RichTextBox and Toolbar, so one of the recently issues is the following: In MSWord document... ...with Font Family Times New Roman, 11, Justify a single line contains 95 Chars ...with Font Family Times New Roman, 11, Justify, Bold a single line contains 83 Chars about margins It will be more recommended to work with margins or limit chars per line? Cause when user inputs are , . or anothers ASCII wich size is shorter than others ones, the max

YUI Editor: Getting rid of <html> tags in content

泄露秘密 提交于 2019-12-11 15:56:26
问题 I implemented the YUI rich text editor and I would like to get rid of the <html> , <body> and DOCTYPE tags as soon as I save the content from the editor. I know I could do this afterwards by parsing the HTML, but there must be a better solution. Right now this is saved when I edit a text in the YUI editor: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"> <html> <body> <p>foo</p> </body> </html> ...but I would like to just save this: <p

C# - Find/Edit/Replace String

喜欢而已 提交于 2019-12-11 14:42:25
问题 I am trying to retrieve data from a file to change it and replace the old data. I have a file that looks something like this: TEXT NEXT_TEXT 10.505 -174.994 0 TEXT NEXT_TEXT 100.005 174.994 90 TEXT NEXT_TEXT -10.000 -5.555 180 TEXT NEXT_TEXT -500.987 5.123 270 TEXT NEXT_TEXT 987.123 1.000 180 TEXT NEXT_TEXT 234.567 200.999 90 I am trying to grab the 3rd and 4th columns to change the data based on what a user inputs into two TextBoxes . Let's label the 3rd column "X" and the 4th column "Y" .