samedi 14 mars 2015

Value of a specific line of RichTextBox not changing

I am trying to do very simple thing which should work but unfortunately its not working.


I have a RichTextBox component on my Winform. I am trying to change text value of some lines of the RichTextBox but its not changing the value. Here is my code:



private void button1_Click(object sender, EventArgs e)
{
for(int i=0; i < richTextBox1.Lines.Length; i++)
{
if(richTextBox1.Lines[i] == "ok")
{
richTextBox1.Lines[i] = "Done";
}
}
}


I put break point and I notice that it executes


richTextBox1.Lines[i] = "Done";


But it does not change the value at all. Can anyone explain it? Why its not modifying the value? Is there way to change/modify the value as per Line?


Thanks and Regards


Aucun commentaire:

Enregistrer un commentaire