c# - RichTextBox.Select(0,1) configures whole text -


this codesnippet:

  richtextbox1.select(0, 1);   richtextbox1.selectionbackcolor = color.black;   richtextbox1.selectioncolor = color.white; 

after part executed first symbol of text selected, whole code formated.

here's whole methode:

where proccesses list<system.diagnostics.proccess>

and knownprocesses list<proccessdata>

processdata "datawrapper" wrote

    void updatertb1()     {         string text = "";          (int = 0; < processes.count; i++)         {             foreach (processdata pd in knownprocesses)             {                 if (pd.resembles(processes[i]))                 {                     text += pd.tostring();                     break;                 }             }              text += "\n";         }          richtextbox1.text = text;          richtextbox1.select(0, 1);         richtextbox1.selectionbackcolor = color.black;         richtextbox1.selectioncolor = color.white;     } 

the methode called once in constructor of containing form. time use far.

thank help

  richtextbox1.select(1, 1);   richtextbox1.selectionbackcolor = color.black;   richtextbox1.selectioncolor = color.white; 

works fine btw.


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -