How to add new line in textbox in C#

1 Answer

0 votes
namespace WinFormsApp1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            textBox1.Multiline = true;
            textBox1.Height = 36;

            textBox1.Text = "c#";
            textBox1.Text += Environment.NewLine;
            textBox1.Text += "programming";
        }
    }
}




/*
 * run:
 *
 * 
 * 
 */

 



answered Aug 13, 2023 by avibootz
...