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

CreateControl() public method

public CreateControl ( ) : void
return void
		public void CreateControl ()
		{
			if (is_created)
			{
				return;
			}
			
			if (is_disposing)
			{
				return;
			}
			
			if (!is_visible)
			{
				return;
			}
			
			if (parent != null && !parent.Created)
			{
				return;
			}
			
			
			if (!is_created)
			{
				is_created = true;
				
				// Create all of our children (implicit ones as well) when we are created.
				// The child should fire it's OnLoad before the parents, however
				// if the child checks Parent.Created in it's OnCreateControl, the
				// parent is already created.
				foreach (Control c in Controls.GetAllControls ())
					if (!c.Created && !c.IsDisposed)
						c.CreateControl ();
				
				OnCreateControl ();
			}
		}

Usage Example

		static WindowsFormsSynchronizationContext ()
		{
			invoke_control = new Control ();
			invoke_control.CreateControl ();
			auto_installed = true;
			previous_context = SynchronizationContext.Current;
		}
All Usage Examples Of System.Windows.Forms.Control::CreateControl
Control