New to Telerik UI for WinForms? Start a free 30-day trial

This is a base class for a behavior that can be associated with a RadFormControlBase instance. The behavior defines the behavior and appearance of the form.

Definition

Namespace:Telerik.WinControls.UI

Assembly:Telerik.WinControls.UI.dll

Syntax:

C#
public abstract class FormControlBehavior : Component, IComponent, IDisposable

Inheritance: objectMarshalByRefObjectComponentFormControlBehavior

Derived Classes: ThemedFormBehavior

Implements: IComponentIDisposable

Constructors

Creates an instance of the RadFormBehaviorBase class. This instance has no Form associated with it.

C#
public FormControlBehavior()

Creates an instance of the RadFormBehavior class.

C#
public FormControlBehavior(IComponentTreeHandler targetTreeHandler, bool handleCreateChildItems)
Parameters:targetTreeHandlerIComponentTreeHandler

An implementation of the IComponentTreeHandler which this behavior applies to

handleCreateChildItemsbool

Creates an instance of the RadFormBehaviorBase class.

C#
public FormControlBehavior(IComponentTreeHandler targetTreeHandler)
Parameters:targetTreeHandlerIComponentTreeHandler

An implementation of the IComponentTreeHandler which this behavior applies to

Fields

The component tree whose root form is managed by this behavior.

C#
protected IComponentTreeHandler targetHandler

Properties

Gets the width of the form border

C#
public abstract Padding BorderWidth { get; }

Gets the height of the caption that is drawn by the behavior.

C#
public abstract int CaptionHeight { get; }

Gets the margin that describes the size and position of the client area.

C#
public abstract Padding ClientMargin { get; }

Gets the RadElement instance that represents the root element containing the hierarchy that builds the visual appearance of the form.

C#
public abstract RadElement FormElement { get; }

Methods

Invokes the associated form's base window-procedure callback when one has been registered.

C#
protected void CallBaseWndProc(ref Message m)
Parameters:mMessage

The window message to pass to the base procedure.

Invokes the associated form's default window-procedure callback when one has been registered.

C#
protected void CallDefWndProc(ref Message m)
Parameters:mMessage

The window message to pass to the default procedure.

Provides a hook for behaviors that take responsibility for creating the form's child elements. The form calls this method when the behavior is configured to handle child-item creation.

C#
public virtual void CreateChildItems(RadElement parent)
Parameters:parentRadElement

The root element that receives the child items.

Adjusts the native window parameters before the form creates its handle. The base implementation returns the supplied parameters unchanged.

C#
public virtual CreateParams CreateParams(CreateParams parameters)
Parameters:parametersCreateParams

The native window parameters to adjust.

Returns:

CreateParams

The parameters used to create the form handle.

Clears the registered window-procedure callbacks when disposing and prevents repeated cleanup.

C#
protected override void Dispose(bool disposing)
Parameters:disposingbool

Whether managed resources are being disposed; callbacks are cleared only when true.

Overrides: Component.Dispose(bool)

Called after the associated form's handle is created so derived behaviors can initialize handle-dependent state.

C#
public virtual void FormHandleCreated()

Processes a window message before the form falls back to its ordinary WndProc(ref Message).

C#
public abstract bool HandleWndProc(ref Message m)
Parameters:mMessage

The window message to process.

Returns:

bool

true if handled; false to let the form call its ordinary window procedure.

Invalidates the specified element bounds using the form's behavior-specific rendering path.

C#
public abstract void InvalidateElement(RadElement element, Rectangle bounds)
Parameters:elementRadElement

The element whose rendering changed.

boundsRectangle

The bounds to invalidate.

Gives the behavior an opportunity to paint the form's client area.

C#
public virtual bool OnAssociatedFormPaint(PaintEventArgs args)
Parameters:argsPaintEventArgs

The paint arguments for the associated form.

Returns:

bool

true if the behavior handled painting and the form should skip its default paint path.

Gives the behavior an opportunity to paint the form's background.

C#
public virtual bool OnAssociatedFormPaintBackground(PaintEventArgs args)
Parameters:argsPaintEventArgs

The background-paint arguments for the associated form.

Returns:

bool

true if the behavior handled painting and the form should skip its default background paint.

Occurs when a form is associated with the behavior.

C#
protected virtual void OnFormAssociated()