私が行っているループに対して値を設定したいテキストボックスとコンボボックスの配列があります。preinput1 と postinput1 はテキストボックスですが、preinput5 と postinput5 はコンボボックスです。コンボボックスを textbox として参照しようとしているエラー: "TextBox tb" 。
var StringInput = new object[] { preInput1, preInput5, postInput1, postInput5};
int stringCount1 = 0;
int toto = (ArrayCount + StringInput.Length);
foreach (TextBox tb in StringInput)
{
tb.Text = Convert.ToString(energyCalculation.Cells[place[xCSV]].Value);
xCSV++;
//stringCount1++;
ArrayCount++;
}
1つずつ処理するために分割することは避けたいです。TextBox の代わりに他に何が書けるか、またはもっと良い方法がありますか。
乾杯、