You need to go through all the controls to find the right one.
Here is a great example for you. You should be able to copy and paste and invoke it without mods.
Insert code snippet in case the link dies :
/// <summary> /// Finds a Control recursively. Note finds the first match and exists /// </summary> /// <param name="container">The container to search for the control passed. Remember /// all controls (Panel, GroupBox, Form, etc are all containsers for controls /// </param> /// <param name="name">Name of the control to look for</param> public Control FindControlRecursive(Control container, string name) { if (container == name) return container; foreach (Control ctrl in container.Controls) { Control foundCtrl = FindControlRecursive(ctrl, name); if (foundCtrl != null) return foundCtrl; } return null; }
source share