このコードを使用して、実行時にテキストボックスコンポーネントを作成できます。
List<TextBox> customTextBox = new List<TextBox>();
foreach (string ValutaCustomScelta in Properties.Settings.Default.ValuteCustom)
{
TextBox textbox = new TextBox();
textbox.Location = new System.Drawing.Point(295, 117 + customTextBox.Count * 26); textbox.BackColor = Color.Black;
textbox.ForeColor = Color.Lime;
textbox.Parent = tabPage2;
textbox.Name = "textbox_" + SelectValute;
textbox.Size = new System.Drawing.Size(80, 21);
customTextBox.Add(textbox);
tabPage2.Controls.Add(textbox);
tabPage2.Controls.SetChildIndex(textbox, 0);
}
このコードはフォーム2に配置されますが、テキストボックスがフォーム1になるように作成する必要があります。このコードに追加するためにどの命令が必要かわかりません。
前もって感謝します