using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace BuildField { public partial class Form1 : Form { // 単独 //private TextBox textBox1; // 配列 private TextBox[] textBoxArray; public Form1() { InitializeComponent(); controlInit(); } private void controlInit() { textBoxArray = new TextBox[1]; // インスタンス作成 textBoxArray[0] = new TextBox(); // フォント設定 textBoxArray[0].Font = new Font("MS UI Gothic", 12F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(128))); // 位置設定 textBoxArray[0].Location = new Point(208, 42); // 名称設定 textBoxArray[0].Name = "textBox1"; // 幅と高さの設定 textBoxArray[0].Size = new Size(208, 23); // TAB の順序 textBoxArray[0].TabIndex = 0; Controls.Add(textBoxArray[0]); } } }