// createctrl.cs using System; using System.Reflection; using System.Drawing; using System.Windows.Forms; class CreateControl { static void Main() { string ctrlName = "System.Windows.Forms.TextBox"; Assembly a = typeof(Control).Assembly; Control ctrl = (Control)a.CreateInstance(ctrlName); ctrl.Text = ctrlName; ctrl.Location = new Point(30, 30); ctrl.Width = 200; Form myform = new Form(); myform.Controls.Add(ctrl); Application.Run(myform); } } // コンパイル方法:csc createctrl.cs