using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace WindowsFormsApplication1 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } Hoge Hoge1 = new Hoge(-1); Hoge[] Hoge2 = new Hoge[10] { new Hoge(0),new Hoge(1),new Hoge(2),new Hoge(3),new Hoge(4), new Hoge(5),new Hoge(6),new Hoge(7),new Hoge(8),new Hoge(9), }; private void Form1_Load(object sender, EventArgs e) { TextBox t = new TextBox(); t.Multiline = true; t.Dock = DockStyle.Fill; this.Controls.Add(t); foreach (Hoge h in Hoge2) { t.AppendText(h.age.ToString() + Environment.NewLine); } } } public class Hoge { public int age { get; set; } public Hoge(int Age) { this.age = Age; } } }