[]
        
(Showing Draft Content)

C1.Framework.ControlHostElement

ControlHostElement Class

Element that hosts a WinForms Control.

Inheritance
ControlHostElement
Namespace: C1.Framework
Assembly: C1.Win.4.8.dll
Syntax
public class ControlHostElement : Element, ISupportUia, IControlHostElement
Remarks

In principle, this class allows hosting any WinForms control. In practice, not all controls work well in this scenario. For example, some controls cannot be freely resized, so the element should account for that.

** Important Note: to allow hosting generic controls, this class stores a reference to itself in the contained control's Tag property. That means hosted controls cannot use their Tag property for anything else.

Constructors

Name Description
ControlHostElement()

Initializes a new instance of the ControlHostElement.

ControlHostElement(Style)

Initializes a new instance of the ControlHostElement with the specified style.

ControlHostElement(Style, Control)

Initializes a new instance of the ControlHostElement with the specified style and control to host.

ControlHostElement(Control)

Initializes a new instance of the ControlHostElement with the specified control to host.

Properties

Name Description
Control

Gets or sets the Control that this element is hosting.

HostPanel

If overriden in nested classes and returns not null, InputPanel will use the HostPanel to make Control scrollable withing the element.

HostedControl

Gets the Control that is hosted in this element.

Methods

Name Description
ApplyStyle()

Copies style attributes from the element to the hosted control.

OnGotFocus(EventArgs)

Called by the host control when this Element receives the focus.

OnLostFocus(EventArgs)

Called by the host control when this Element loses the focus.

OnMouseLeave(EventArgs)

Called by the host control when the mouse leaves this Element.

OnTextChanged(EventArgs)

Override to get text change notifications.

Render(Graphics, Rectangle)

Renders the element into a given rectangle.

UpdateControlBounds()

Updates the hosted control bounds to match the element's bounds.