Hello,
I have a RichBox(memo) that I'd like to add lines to.
Currently,I use this
RichBox1.text += "the line I'd like to add" + "\n";
Isn't there something like the method in Delphi below?
Memo.Lines.add('The line I''d like to add');
Hello,
I have a RichBox(memo) that I'd like to add lines to.
Currently,I use this
RichBox1.text += "the line I'd like to add" + "\n";
Isn't there something like the method in Delphi below?
Memo.Lines.add('The line I''d like to add');
AppendText is the closest it gets. Unfortunately you still have to append the newline character:
RichBox1.AppendText( "the line I'd like to add" + Environment.NewLine );
You can use the AppendText method from TextBoxBaseand explicitly add the new line
RichBox1.AppendText("the line i'd like to add" + Environment.NewLine);
You could use an extension method to add this handy add
method to the RichTextBox class.
http://msdn.microsoft.com/en-us/library/bb383977.aspx
public static class Extension
{
public static void add(this System.Windows.Forms.RichTextBox richText, string line)
{
richText.Text += line + '\n';
}
}