Nov 1, 2005 #1 luisve Programmer Jun 24, 2005 29 US hi i am sending a string to a richtexbox,but if i send another one the last one replaces the last one, how can i add the second string to a new line?
hi i am sending a string to a richtexbox,but if i send another one the last one replaces the last one, how can i add the second string to a new line?
Nov 1, 2005 #2 marsh Programmer Mar 20, 2001 45 US Have you tried Code: RTBox.RTF = string1.Trim() + "\n\r" + "\n\r" + string2.Trim(); where \n\r is the carriage return + line feed? Upvote 0 Downvote
Have you tried Code: RTBox.RTF = string1.Trim() + "\n\r" + "\n\r" + string2.Trim(); where \n\r is the carriage return + line feed?
Nov 1, 2005 #3 earthandfire Programmer Mar 14, 2005 2,924 GB Unless you are using the Rich Text Format then : richTextBox1.Text += Environment.NewLine + "Another line"; will do what you need. In RTF \par is the new paragraph code however creating an RTF document is not straightforward, see: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnrtfspec/html/rtfspec.asp for a detailed explanation. Hope this helps. Upvote 0 Downvote
Unless you are using the Rich Text Format then : richTextBox1.Text += Environment.NewLine + "Another line"; will do what you need. In RTF \par is the new paragraph code however creating an RTF document is not straightforward, see: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnrtfspec/html/rtfspec.asp for a detailed explanation. Hope this helps.
Nov 2, 2005 Thread starter #4 luisve Programmer Jun 24, 2005 29 US Thanks for the help!!! Upvote 0 Downvote