public virtual int GetChildIndex (Control child, bool throwException) { int index; index = list.IndexOf (child); if (index == -1 && throwException) { throw new ArgumentException ("Not a child control", "child"); } return index; }