move cursor automatically in a richtextbox

Please support our C# advertiser: Intel Parallel Studio Home
Thread Solved

Join Date: Mar 2008
Posts: 33
Reputation: SubProf is an unknown quantity at this point 
Solved Threads: 0
SubProf's Avatar
SubProf SubProf is offline Offline
Light Poster

move cursor automatically in a richtextbox

 
0
  #1
Jun 4th, 2008
Hello,

I have a richtextbox which I write lines of data to. However, everytime a new line is written to the richtextbox it overwrites the last line of data so therefore after the progam runs only the last line of data is displayed in the richtextbox. I need the lines to be displayed in a list but I don't know what code I can use to make sure the cursor moves to a new line before writting the data to the richtextbox.

I appreciate any help I can get with this problem.

Thanks in advance,

SubProf
Reply With Quote Quick reply to this message  
Join Date: Feb 2008
Posts: 509
Reputation: selvaganapathy is an unknown quantity at this point 
Solved Threads: 88
selvaganapathy's Avatar
selvaganapathy selvaganapathy is offline Offline
Posting Pro

Re: move cursor automatically in a richtextbox

 
0
  #2
Jun 4th, 2008
Hi,
I think u not appending the text in Richtextbox rather u are assign a text
For Ex
richText1.Text = someString; U can try

richText1.Text += someString;
or

richText1.AppendText ( someString );
Example Code
  1. string[] str = { "C#", "Programming", "language"};
  2.  
  3. foreach (string s in str)
  4. {
  5. //richTextBox1.Text += s;
  6. //or
  7. richTextBox1.AppendText(s);
  8. }
Last edited by selvaganapathy; Jun 4th, 2008 at 12:57 pm.
KSG
Reply With Quote Quick reply to this message  
Join Date: Mar 2008
Posts: 33
Reputation: SubProf is an unknown quantity at this point 
Solved Threads: 0
SubProf's Avatar
SubProf SubProf is offline Offline
Light Poster

Re: move cursor automatically in a richtextbox

 
0
  #3
Jun 4th, 2008
Thank you for your help selvaganapathy - the code you suggested worked.

Thanks again,

SubProf
Last edited by SubProf; Jun 4th, 2008 at 1:02 pm.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC