Dave Fitter

Dave Fitter

  • NA
  • 1
  • 0

creating new labels within a form

Dec 18 2008 9:44 AM

Help needed! I want to pass text from a text box to a label, but then once that label has text in it,  for the program to create a new label underneath the previous one, so when i add some more text it fills the new label and so on and so on.  The code below will take the text you write and put it into the label, but i cant figure out how to do it with more than one, except by using if / else if statements which i do not want to do.

namespace WindowsApplication1

{

   public partial class Form1 : Form

   {

   public Form1()

      {

      InitializeComponent();

      }

      private void button1_Click(object sender, EventArgs e)

      {

      string a = textBox1.Text;

      label1.Text = a;

       }

}


Answers (1)