Hi,
Try something like this.
textBox1.Text="";
for(int i = 0; i < 5; i++)
{
textBox1.Text += String.Format("Line{0}\r\n",i );
}
string strText = textBox1.Text;
strText = strText.Replace(textBox1.Lines[1],"any text that i want to
display");
textBox1.Text=strText;
Ken
-----------------------
Hi All,
There is a problem with me i want to set a value of specific line of text
box.
there is a property lines that is an array of lines from text box.
there are three lines of text in my text box.
i want to change my text box second line from c# and use this line of
coding.
myTextBox.Lines[1] = "any text that i want to display";
but there is not any risponse.
Please help me
Amir Hussain
amir_hussain72@hotmail.com
Amir Hussain - 24 Jul 2004 22:38 GMT
Thanks Ken Tucker,
Now it is working fine, but can i ask you why it doesn't working directly. I mean
why not working as
mytextBox.Lines[1] = "any text";
Amir Hussain;
> Hi,
>
[quoted text clipped - 33 lines]
> Amir Hussain
> amir_hussain72@hotmail.com
Amir Hussain - 24 Jul 2004 22:39 GMT
Thanks Ken Tucker,
but why it not working directly i mean
textBox.Lines[1] = "any text";
why this not working..
Again Thanks
> Hi,
>
[quoted text clipped - 33 lines]
> Amir Hussain
> amir_hussain72@hotmail.com