Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>In order to better understand what's happening <em>under the hood</em>, I recommend you to install <a href="http://ilspy.net/" rel="nofollow">ILSpy</a>. Open <code>System.Windows.Forms</code> from the GAC and take a look at the <code>Control</code> class.</p> <p>The exhibit B <strong>will work</strong> because the <code>Controls</code> property of the <code>System.Windows.Form.Control</code> class contains all the controls, disregarding their modifiers:</p> <pre><code>public Control.ControlCollection Controls { get { Control.ControlCollection controlCollection = (Control.ControlCollection)this.Properties.GetObject(Control.PropControlsCollection); if (controlCollection == null) { controlCollection = this.CreateControlsInstance(); this.Properties.SetObject(Control.PropControlsCollection, controlCollection); } return controlCollection; } } </code></pre> <p>Where <code>CreateControlsInstance</code> is:</p> <pre><code>protected virtual Control.ControlCollection CreateControlsInstance() { return new Control.ControlCollection(this); } </code></pre> <p>So the <code>System.Windows.Forms.Control.ControlCollection.Find</code> method, which is <code>public</code>, searches the specidfied control name over the <strong>whole</strong> control collection:</p> <pre><code>public Control[] Find(string key, bool searchAllChildren) { if (string.IsNullOrEmpty(key)) { throw new ArgumentNullException("key", SR.GetString("FindKeyMayNotBeEmptyOrNull")); } ArrayList arrayList = this.FindInternal(key, searchAllChildren, this, new ArrayList()); Control[] array = new Control[arrayList.Count]; arrayList.CopyTo(array, 0); return array; } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload