title: c# dynamic control name
body: <p>I am trying to create controls at runtime by using an XML file. How would I access these controls after creating them with names specified by the XML file?</p>
  
  <p>For instance, if I had a series of controls in an XML file:</p>
  
  <pre><code>&lt;control id="0" type="textbox"&gt;
     &lt;param id="0" type="(name)"&gt;DynamicTextbox&lt;/param&gt;
     &lt;param id="1" type="location"&gt;100,73&lt;/param&gt;
     &lt;param id="2" type="size"&gt;119,20&lt;/param&gt;
  &lt;/control&gt;
  &lt;control id="1" type="button"&gt;
     &lt;param id="0" type="(name)"&gt;DynamicButton&lt;/param&gt;
     &lt;param id="1" type="location"&gt;200,82&lt;/param&gt;
     &lt;param id="2" type="size"&gt;78,50&lt;/param&gt;
  &lt;/control&gt;
  </code></pre>
  
  <p>If I designed the UI in design mode, and I didn't use the XML file, I could simply call the controls with their respective names.</p>
  
  <pre><code>DynamicTextbox.location = new Point(100,73);
  DynamicTextbox.size = new Size(119,20);
  
  DynamicButton.location = new Point(200,82);
  DynamicButton.size = new Size(78,50);
  </code></pre>
  
  <p>Since I am creating the controls at runtime, how would I access them with those names?</p>
  
  <p>Thanks!</p>