using System.Collections;

public class Form1 : System.Windows.Forms.Form
{
   private AlarmList report;

   public Form1()
   {
      this.report = new AlarmList();
   }

   private void button1_Click(object sender, System.EventArgs e)
   {
      string title = textBox1.Text;
      this.report.Add(title);
      UpdateListBox();
   }

   //リストボックスを更新するメソッド
   private void UpdateListBox()
   {
      ArrayList items = this.report.GetItems();
      IEnumerator it = items.GetEnumerator();
      listBox1.Items.Clear();

      while(it.MoveNext())
      {
         AlarmData item = (AlarmData)(it.Current);
         listBox1.Items.Add(item.ToString()); //.ToString()がないとListBoxに文字列が表示されない
      }
   }
}