mercredi 11 mars 2015

Highlight entire line in Richtextbox if a text is present

enter image description here


I'm trying to highlight a particular line in my RichTextBox as shown in figure.



int ptrsize = 10;
int* linenum;
for (int i = 0; i < ptrsize; i++)
{
int value = (linenum[i]) * 10;
string searchText = value.ToString();
int indexToText = richTextBox.Find(searchText);
int endIndex = searchText.Length;
richTextBox.Select(indexToText, endIndex);
richTextBox.SelectionColor = Color.Blue;
}


If a text is present (i.e. 2010), i want to highlight the entire line.


2010 19.5 7.37 105 0.67 0.26 0.69


Aucun commentaire:

Enregistrer un commentaire