1

TextBoxボタンをクリックすると、動的にフォームを作成し、そのデータを取得して、同じフォーム内の別の TextBox に貼り付けたいと考えています。

テックスボックスを動的に作成するために次のコードを使用しました。

public int c=0;
private void button1_Click(object sender, EventArgs e)
{

    string n = c.ToString();
    txtRun.Name = "textname" + n;

    txtRun.Location = new System.Drawing.Point(10, 20 + (10 * c));
    txtRun.Size = new System.Drawing.Size(200, 25);
    this.Controls.Add(txtRun);
} 

この TextBox からデータを取得するためのコードが必要です

4

2 に答える 2