How to get the text lines from a TextBox with WinForms in C#

1 Answer

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

        private void button1_Click(object sender, EventArgs e)
        {
            string[] lines = textBox1.Lines;

            MessageBox.Show(string.Join(", ", lines));
        }
    }
}




/*
run:
 

  
*/

 



answered Jan 4, 2024 by avibootz

Related questions

1 answer 167 views
1 answer 158 views
1 answer 179 views
1 answer 148 views
1 answer 123 views
...