In VB I can loop through controls, or refer to a control by concatenating a variable to a string. Something like:
Dim I as integer
I = 1
Me["Textbox" & I].Text = "Some text"
What is the C# equivalent of this last statement?
You can access the control by the control's name:
Me.Controls("TextBox" & I).Text = "Some text"
And the same in C#:
this.Controls["TextBox" + I].Text = "Some text";
int i = 1;
this.Controls["TextBox" & i].Text = "Some text";
The above code is assuming that it is in a Control/Form.
int I = 1;
this["Textbox" + I].Text = "some text";
OR
int I = 1;
this.Page["Textbox" + I].Text = "some text";
OR
int I = 1;
this.Controls["Textbox" + I].Text = "some text";
Me["Textbox" & I].Text = "Some text"works in VBNet?