Name

ContainerControl

Synopsis

This control extends ScrollableControl and also implements the IContainerControl interface. It provides the base functionality required to manage the focus control and tab ordering for the controls that it hosts. It also adds support for a ParentForm member, which provides the root containing form for the control, and the ActiveControl (implementing the IContainerControl interface), which determines which of the hosted controls has the focus.

Note that the ContainerControl never takes the focus itself. It always passes it through to one of the contained controls.

You would not normally derive your own containers from this class. Instead, you should look at UserControl or Form.


public class ContainerControl : ScrollableControl : IContainerControl {

// Public Constructors

   public ContainerControl();

// Public Instance Properties

   public Control ActiveControl{set; get; }

// implements IContainerControl

   public override BindingContext BindingContext{set; get; } // overrides Control

   public Form ParentForm{get; }

// Protected Instance Properties

   protected override CreateParams CreateParams{get; } // overrides ScrollableControl

                  // Public Instance Methods

   public bool Validate();

// Protected Instance Methods

   protected override void AdjustFormScrollbars(bool displayScrollbars);  // overrides ScrollableControl

   protected override void Dispose(bool disposing);  // overrides Control

   protected override void OnControlRemoved(ControlEventArgs e);  // overrides Control protected ...

Get .NET Windows Forms in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.