c# - How to change the format of specified lines in a RichTextBox -


I have a rich textbox with rows of lots of text (for example, 2 MB text files), and programmatically It would like to change the formatting of specified lines, such as highlighting them.

How do I address lines instead of letters? Is this type of richtextbox also the best control, or is there any other option? I have tried InfraGivicics UltraFormattextExtet editor, but some commands of the least magnitude were slow to display the text, so there is no good for my long files.

Thank you!

You use Lines property to access lines of text box controls

< P> richTextBox.Lines

From there you can repeat through lines and work with people you want to change.

EDIT: Agree, I was reminded to highlight part (1 to answer your own question). Working code is included:

  int lineCounter = 0; Foreach (string line in RichTextBox1.Lines) {// Add conditional statement if all the lines choose Rich Textbox. Select (Rich Textbox .GetFurstchirefamline (Line-Quarter), Line.); RichTextBox.SelectionColor = Color.Red; LineCounter ++; }  

Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -