Find a control in Windows Forms by name

You can use the form’s Controls.Find() method to retrieve a reference back:

        var matches = this.Controls.Find("button2", true);

Beware that this returns an array, the Name property of a control can be ambiguous, there is no mechanism that ensures that a control has a unique name. You’ll have to enforce that yourself.

Leave a Comment