System.Windows.Forms.ContainerControl.ChildControlRemoved C# (CSharp) Method

ChildControlRemoved() private method

private ChildControlRemoved ( Control control ) : void
control Control
return void
		internal void ChildControlRemoved (Control control)
		{
			ContainerControl top_container = FindForm ();
			if (top_container == null)
				top_container = this;

			// Remove controls -as well as any sub control- that was in the pending validation chain
			ArrayList pending_validation_chain = top_container.pending_validation_chain;
			if (pending_validation_chain != null) {
				RemoveChildrenFromValidation (pending_validation_chain, control);

				if (pending_validation_chain.Count == 0)
					top_container.pending_validation_chain = null;
			}

			if (control == active_control || control.Contains (active_control)) {
				SelectNextControl (this, true, true, true, true);
				if (control == active_control || control.Contains (active_control)) {
					active_control = null;
				}
			}
		}