Class
ThemedFormBehavior

This class represents a base class for all behaviors that modify the non-client area of the form and enable custom painting in it.

Definition

Namespace:Telerik.WinControls.UI

Assembly:Telerik.WinControls.UI.dll

Syntax:

cs-api-definition
public abstract class ThemedFormBehavior : FormControlBehavior, IComponent, IDisposable

Inheritance: objectMarshalByRefObjectComponentFormControlBehaviorThemedFormBehavior

Derived Classes: RadFormBehaviorRadNonClientUIBaseFormBehavior<T>

Implements: IComponentIDisposable

Inherited Members FormControlBehavior.targetHandlerFormControlBehavior.FormHandleCreated()FormControlBehavior.CallBaseWndProc(ref Message)FormControlBehavior.CallDefWndProc(ref Message)FormControlBehavior.OnAssociatedFormPaint(PaintEventArgs)FormControlBehavior.OnAssociatedFormPaintBackground(PaintEventArgs)FormControlBehavior.CreateChildItems(RadElement)FormControlBehavior.FormElementFormControlBehavior.BorderWidthFormControlBehavior.CaptionHeightFormControlBehavior.ClientMarginComponent.Dispose()Component.GetService(Type)Component.ToString()Component.CanRaiseEventsComponent.EventsComponent.SiteComponent.ContainerComponent.DesignModeComponent.DisposedMarshalByRefObject.MemberwiseClone(bool)MarshalByRefObject.GetLifetimeService()MarshalByRefObject.InitializeLifetimeService()MarshalByRefObject.CreateObjRef(Type)

Constructors

ThemedFormBehavior()

Creates an instance of the ThemedFormBehavior class.

Declaration

cs-api-definition
public ThemedFormBehavior()

ThemedFormBehavior(IComponentTreeHandler)

Creates an instance of the RadFormBehavior class.

Declaration

cs-api-definition
public ThemedFormBehavior(IComponentTreeHandler treeHandler)

Parameters

treeHandler

IComponentTreeHandler

An IComponentTreeHandler instance.

ThemedFormBehavior(IComponentTreeHandler, bool)

Creates an instance of the RadFormBehavior class.

Declaration

cs-api-definition
public ThemedFormBehavior(IComponentTreeHandler treeHandler, bool shouldCreateChildren)

Parameters

treeHandler

IComponentTreeHandler

An IComponentTreeHandler instance.

shouldCreateChildren

bool

A flag that determines whether the CreateChildItems call is rerouted to the behavior.

Properties

AllowTheming

Gets or sets a bool value indiciating whether the behavior applies NC theming to the form.

Declaration

cs-api-definition
public abstract bool AllowTheming { get; set; }

Property Value

bool

BottomBorderFrame

This rectangle represents the bottom border frame of a window.

Declaration

cs-api-definition
public virtual Rectangle BottomBorderFrame { get; }

Property Value

Rectangle

BottomLeftResizeFrame

This rectangle represents the bottomleft sizing corner of a window.

Declaration

cs-api-definition
public virtual Rectangle BottomLeftResizeFrame { get; }

Property Value

Rectangle

BottomResizeFrame

This rectangle represents the bottom sizing frame of a window.

Declaration

cs-api-definition
public virtual Rectangle BottomResizeFrame { get; }

Property Value

Rectangle

BottomRightResizeFrame

This rectangle represents the bottomright sizing corner of a window.

Declaration

cs-api-definition
public virtual Rectangle BottomRightResizeFrame { get; }

Property Value

Rectangle

CaptionFrame

This rectangle represents the caption frame of a window.

Declaration

cs-api-definition
public virtual Rectangle CaptionFrame { get; }

Property Value

Rectangle

CaptionTextBounds

Gets the rectangle that contains the form's caption text.

Declaration

cs-api-definition
public abstract Rectangle CaptionTextBounds { get; }

Property Value

Rectangle

ClientFrame

This rectangle represents the client rectangle of a window.

Declaration

cs-api-definition
public virtual Rectangle ClientFrame { get; }

Property Value

Rectangle

CurrentFormParams

Gets the current form CreateParams settings.

Declaration

cs-api-definition
public virtual CreateParams CurrentFormParams { get; }

Property Value

CreateParams

CurrentFormState

Gets an integer value that determines the current Form state: Possible values come from the SIZE_RESTORED, SIZE_MAXIMIZED, SIZE_MINIMIZED win32 constants.

Declaration

cs-api-definition
protected int CurrentFormState { get; }

Property Value

int

Form

Gets or sets the form associated with this behavior. Used only in design-time. IMPORTANT: This property can be assigned only one time. An InvalidOperationException is thrown when the property is assigned more than once.

Declaration

cs-api-definition
public RadFormControlBase Form { get; set; }

Property Value

RadFormControlBase

FormMdiClient

Gets the MdiClient control of the Form. Returns null if the Form is not MdiContainer.

Declaration

cs-api-definition
protected MdiClient FormMdiClient { get; }

Property Value

MdiClient

IconBounds

Gets the rectangle that contains the form's icon.

Declaration

cs-api-definition
public abstract Rectangle IconBounds { get; }

Property Value

Rectangle

IsMaximized

Gets a bool value that determines whether the Form's window state is maximized.

Declaration

cs-api-definition
protected virtual bool IsMaximized { get; }

Property Value

bool

IsMdiChildMaximized

Gets a boolean value showing whether a MDI child form is maximized.

Declaration

cs-api-definition
protected virtual bool IsMdiChildMaximized { get; }

Property Value

bool

IsMenuInForm

Gets a boolean value determining whether there is a Menu in the Form.

Declaration

cs-api-definition
protected bool IsMenuInForm { get; }

Property Value

bool

IsMinimized

Gets a bool value that determines whether the Form's window state is minimized.

Declaration

cs-api-definition
protected virtual bool IsMinimized { get; }

Property Value

bool

IsNormal

Gets a boolean value that determines whether the Form's window state is normal.

Declaration

cs-api-definition
protected virtual bool IsNormal { get; }

Property Value

bool

LeftBorderFrame

This rectangle represents the left border frame of a window.

Declaration

cs-api-definition
public virtual Rectangle LeftBorderFrame { get; }

Property Value

Rectangle

LeftResizeFrame

This rectangle represents the left sizing frame of a window.

Declaration

cs-api-definition
public virtual Rectangle LeftResizeFrame { get; }

Property Value

Rectangle

MainMenuInForm

Declaration

cs-api-definition
protected RadMenu MainMenuInForm { get; }

Property Value

RadMenu

MaximizedMDIChild

Gets the maximized MDI child if any.

Declaration

cs-api-definition
protected Form MaximizedMDIChild { get; }

Property Value

Form

MenuBounds

Gets the rectangle that contains the menu of the form.

Declaration

cs-api-definition
public abstract Rectangle MenuBounds { get; }

Property Value

Rectangle

RightBorderFrame

This rectangle represents the right border frame of a window.

Declaration

cs-api-definition
public virtual Rectangle RightBorderFrame { get; }

Property Value

Rectangle

RightResizeFrame

This rectangle represents the right sizing frame of a window.

Declaration

cs-api-definition
public virtual Rectangle RightResizeFrame { get; }

Property Value

Rectangle

SystemButtonsBounds

Gets the rectangle that contains the system buttons of the form.

Declaration

cs-api-definition
public abstract Rectangle SystemButtonsBounds { get; }

Property Value

Rectangle

TopLeftResizeFrame

This rectangle represents the topleft sizing corner of a window.

Declaration

cs-api-definition
public virtual Rectangle TopLeftResizeFrame { get; }

Property Value

Rectangle

TopResizeFrame

This rectangle represents the top sizing frame of a window.

Declaration

cs-api-definition
public virtual Rectangle TopResizeFrame { get; }

Property Value

Rectangle

TopRightResizeFrame

This rectangle represents the topright sizing corner of a window.

Declaration

cs-api-definition
public virtual Rectangle TopRightResizeFrame { get; }

Property Value

Rectangle

Methods

CreateParams(CreateParams)

Declaration

cs-api-definition
public override CreateParams CreateParams(CreateParams parameters)

Parameters

parameters

CreateParams

Returns

CreateParams

Overrides FormControlBehavior.CreateParams(CreateParams)

Dispose(bool)

Declaration

cs-api-definition
protected override void Dispose(bool disposing)

Parameters

disposing

bool

Overrides FormControlBehavior.Dispose(bool)

GetMappedWindowPoint(Point)

This method transforms screen coordinates into local coordinates.

Declaration

cs-api-definition
protected virtual Point GetMappedWindowPoint(Point screenPoint)

Parameters

screenPoint

Point

The screen point to transform.

Returns

Point

The transformed point. If the handle of the associated Form is not created, the method returns the input.

GetMaximumFormHeightAccordingToCurrentScreen()

This method returns the maximum available height according to the current position of the form in multi-monitor setup.

Declaration

cs-api-definition
protected int GetMaximumFormHeightAccordingToCurrentScreen()

Returns

int

HandleWndProc(ref Message)

Declaration

cs-api-definition
public override bool HandleWndProc(ref Message m)

Parameters

m

Message

Returns

bool

Overrides FormControlBehavior.HandleWndProc(ref Message)

InvalidateElement(RadElement, Rectangle)

Declaration

cs-api-definition
public override void InvalidateElement(RadElement element, Rectangle bounds)

Parameters

element

RadElement

bounds

Rectangle

Overrides FormControlBehavior.InvalidateElement(RadElement, Rectangle)

InvalidateNC(Rectangle)

Invalidates the specified bounds in the non-client area of the form this behavior is associated with.

Declaration

cs-api-definition
protected virtual void InvalidateNC(Rectangle bounds)

Parameters

bounds

Rectangle

OnActiveMDIChildTextChanged()

Declaration

cs-api-definition
protected virtual void OnActiveMDIChildTextChanged()

OnFormAssociated()

Occurs when a form is associated with the behavior.

Declaration

cs-api-definition
protected override void OnFormAssociated()

Overrides FormControlBehavior.OnFormAssociated()

OnGetMinMaxInfo(MinMaxInfo)

This event is fired when the WM_GETMINMAXINFO message is sent to the form.

Declaration

cs-api-definition
protected virtual void OnGetMinMaxInfo(MinMaxInfo minMaxInfo)

Parameters

minMaxInfo

MinMaxInfo

Contains information about the position, maximum/minimum size of the form etc. Can be modified to adjust the settings applied to the form.

OnNCPaint(Graphics)

This event is fired when the WM_NCPAINT message is sent to the form.

Declaration

cs-api-definition
protected virtual void OnNCPaint(Graphics graphics)

Parameters

graphics

Graphics

The NC Graphics.

OnWindowStateChanged(int, int)

Fires when the window state of the form is changed. Uses the SIZE_* values to define the window states.

Declaration

cs-api-definition
protected virtual void OnWindowStateChanged(int currentFormState, int newFormState)

Parameters

currentFormState

int

The old window state of the form.

newFormState

int

The new window state of the form

PaintElement(IGraphics, Rectangle, VisualElement)

Paints an element on a specified graphics.

Declaration

cs-api-definition
protected virtual void PaintElement(IGraphics graphics, Rectangle clipRectangle, VisualElement element)

Parameters

graphics

IGraphics

The Graphics object to paint on.

clipRectangle

Rectangle

The clipping rectangle.

element

VisualElement

The element to paint.

RefreshNC()

Immediately refreshes the whole non-client area of the form which this behavior is associated with.

Declaration

cs-api-definition
protected virtual void RefreshNC()