This should work.. I think..
string ctrlName = "btnSomeButton" + someIndexValue;
this.Controls[ctrlName].Text = "Some value";
I get ‘Object reference not set to an instance of an object.’, the control does exist on the form. I’ve tried casting it.
Solution:
string ctrlName = "btnSomeButton" + someIndexValue;
Control[] ctrl = this.Controls.Find(ctrlName, True);
Button btn = (Button)ctrl[0];
btn.Text = "Some Value";
Thank you.
The control might be a nested control so you’re going to have to dig deeper in the control tree of “this”
Here is a simple recursive control search tool, i wrote it without testing it but i think it should work for your needs: