Possible Duplicate:
Find a control in C# winforms by name
I will try to explain it.. So I have a for loop, and each time I want to load the textbox number equal with the cycle integer.
Here is my code:
for(int i=1 ; i<=indulok+1 ; i++)
{
StreamWriter sw = new StreamWriter("futamok/"+comboBox1.Text + "/" + indulok + ".txt");
sw.WriteLine(textBox1.Text);
sw.Dispose();
}
Now I want to replace textBox1.Text to something like this:
sw.WriteLine(textBox + i + .Text);
But this is not working of course.
Here is an alternative that would find the control by name.
If your control is nested inside other controls (ie. a GroupBox), you may need to use the Find function