Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating a newline in rich text box

I need help on creating a new line for my RichTextBox which I cant make work when using CheckBox.

It keeps overlapping instead of creating a newline of words.

Tried using the method of rtbdisplay.text = (display+envrionment.newline); example from my code:

if (rbtnSmall.Checked == true)
{
    rtbDisplay.Text = "displaytext".PadRight(20) + "size".PadRight(23) +
                      qty.ToString().PadRight(20) + StrongDummy;
}
like image 885
JustASimpleGuy Avatar asked Jul 02 '14 13:07

JustASimpleGuy


1 Answers

Use the RichTextBox.Text property or the RichtTextBox.AppendText method to append a string with a newline.

myRichTextBox.Text += Environment.NewLine + "My new line.";

// Or

myRichTextBox.AppendText( Environment.NewLine + "My new line." );
like image 142
Moez Rebai Avatar answered Sep 28 '22 01:09

Moez Rebai