System.Windows.Forms.Control.FindControlToInvokeOn C# (CSharp) Method

FindControlToInvokeOn() private method

private FindControlToInvokeOn ( ) : Control
return Control
		private Control FindControlToInvokeOn ()
		{
			Control p = this;
			do {
				if (p.IsHandleCreated)
					break;
				p = p.parent;
			} while (p != null);

			if (p == null || !p.IsHandleCreated)
				throw new InvalidOperationException ("Cannot call Invoke or BeginInvoke on a control until the window handle is created");
			
			return p;
		}
Control