title: Display ArrayList entries in multiline TextBox
body: <p>I am having a problem with displaying a content from a ArrayList() stored as such:</p>
  
  <pre><code>private void btnEnter_Click(object sender, EventArgs e)
  {
      public ArrayList books = new ArrayList();
      books = new ArrayList();
  
      // first I am just using lebels for easier input.
      books.Add(new Book(label1.Text, label2.Text, label3.Text, label4.Text, float.Parse(label5.Text)));
  }
  </code></pre>
  
  <p>As we see I am using a constructor to store data with 5 elements. The problem is that I am not sure how to display the data using foreach loop:</p>
  
  <pre><code>public ArrayList books;
  public BookList()
  {
      InitializeComponent();
  
      foreach (string data in books)
          txtBookList.Text = data.ToString();
  }
  </code></pre>
  
  <p>I am trying to display the content in multiline textbox and I am not sure what I'm exacly doing wrong. Any tips?</p>
  
  <p>Here is the code for Book() constructor:</p>
  
  <pre><code>public Book(string title, string firstName, string lastName, string publisherName, float price)
  : base(title, publisherName, price)
  {
      this.authorFirstName = firstName;
      this.authorLastName = lastName;
  } 
  </code></pre>
  
  <p>-- EDIT --
  One person pointed out that I do want to display the ArrayList as a objects. How would I do it?</p>
  
  <p>Regards. </p>
  
  <p>HelpNeeder</p>