Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / July 2004

Tip: Looking for answers? Try searching our database.

textBox Lines property does not working..

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Amir Hussain - 24 Jul 2004 00:19 GMT
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
Ken Tucker [MVP] - 24 Jul 2004 14:07 GMT
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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.