Class
RadFormBehavior

A standard behavior for RadForm.

Definition

Namespace:Telerik.WinControls.UI

Assembly:Telerik.WinControls.UI.dll

Syntax:

cs-api-definition
public class RadFormBehavior : ThemedFormBehavior, IComponent, IDisposable

Inheritance: objectMarshalByRefObjectComponentFormControlBehaviorThemedFormBehaviorRadFormBehavior

Implements: IComponentIDisposable

Inherited Members ThemedFormBehavior.GetMappedWindowPoint(Point)ThemedFormBehavior.GetMaximumFormHeightAccordingToCurrentScreen()ThemedFormBehavior.RefreshNC()ThemedFormBehavior.InvalidateNC(Rectangle)ThemedFormBehavior.OnGetMinMaxInfo(MinMaxInfo)ThemedFormBehavior.OnNCPaint(Graphics)ThemedFormBehavior.PaintElement(IGraphics, Rectangle, VisualElement)ThemedFormBehavior.IsMaximizedThemedFormBehavior.IsMinimizedThemedFormBehavior.IsNormalThemedFormBehavior.CurrentFormStateThemedFormBehavior.IsMdiChildMaximizedThemedFormBehavior.FormMdiClientThemedFormBehavior.IsMenuInFormThemedFormBehavior.MainMenuInFormThemedFormBehavior.MaximizedMDIChildThemedFormBehavior.TopResizeFrameThemedFormBehavior.TopLeftResizeFrameThemedFormBehavior.LeftResizeFrameThemedFormBehavior.BottomLeftResizeFrameThemedFormBehavior.BottomResizeFrameThemedFormBehavior.BottomRightResizeFrameThemedFormBehavior.RightResizeFrameThemedFormBehavior.TopRightResizeFrameThemedFormBehavior.CaptionFrameThemedFormBehavior.LeftBorderFrameThemedFormBehavior.BottomBorderFrameThemedFormBehavior.RightBorderFrameThemedFormBehavior.ClientFrameThemedFormBehavior.CurrentFormParamsThemedFormBehavior.FormFormControlBehavior.targetHandlerFormControlBehavior.FormHandleCreated()FormControlBehavior.CallBaseWndProc(ref Message)FormControlBehavior.CallDefWndProc(ref Message)FormControlBehavior.OnAssociatedFormPaint(PaintEventArgs)FormControlBehavior.OnAssociatedFormPaintBackground(PaintEventArgs)Component.Dispose()Component.GetService(Type)Component.ToString()Component.CanRaiseEventsComponent.EventsComponent.SiteComponent.ContainerComponent.DesignModeComponent.DisposedMarshalByRefObject.MemberwiseClone(bool)MarshalByRefObject.GetLifetimeService()MarshalByRefObject.InitializeLifetimeService()MarshalByRefObject.CreateObjRef(Type)

Constructors

RadFormBehavior()

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

Declaration

cs-api-definition
public RadFormBehavior()

RadFormBehavior(IComponentTreeHandler)

Creates an instance of the RadFormBehavior class.

Declaration

cs-api-definition
public RadFormBehavior(IComponentTreeHandler treeHandler)

Parameters

treeHandler

IComponentTreeHandler

An IComponentTreeHandler instance.

RadFormBehavior(IComponentTreeHandler, bool)

Creates an instance of the RadFormBehavior class.

Declaration

cs-api-definition
public RadFormBehavior(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 boolean value indicating whether the behavior paints in the NC area of the Form when OS is Vista or later and Composition is enabled.

Declaration

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

Property Value

bool

Overrides ThemedFormBehavior.AllowTheming

BorderWidth

Gets the Border width of the Form.

Declaration

cs-api-definition
public override Padding BorderWidth { get; }

Property Value

Padding

Overrides FormControlBehavior.BorderWidth

CaptionHeight

Gets the Caption Height of the Form.

Declaration

cs-api-definition
public override int CaptionHeight { get; }

Property Value

int

Overrides FormControlBehavior.CaptionHeight

CaptionTextBounds

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

Declaration

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

Property Value

Rectangle

Overrides ThemedFormBehavior.CaptionTextBounds

ClientMargin

Gets the margin that determines the position and size of the client area of the Form.

Declaration

cs-api-definition
public override Padding ClientMargin { get; }

Property Value

Padding

Overrides FormControlBehavior.ClientMargin

FormElement

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

Declaration

cs-api-definition
public override RadElement FormElement { get; }

Property Value

RadElement

Overrides FormControlBehavior.FormElement

HorizontalScrollbarBounds

Gets the bounding rectangle of the horizontal scrollbar. Returns an empty rectangle if the scrollbar is not visible.

Declaration

cs-api-definition
protected virtual Rectangle HorizontalScrollbarBounds { get; }

Property Value

Rectangle

IconBounds

Gets the rectangle that contains the form's icon.

Declaration

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

Property Value

Rectangle

Overrides ThemedFormBehavior.IconBounds

MenuBounds

Gets the rectangle that contains the menu of the form.

Declaration

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

Property Value

Rectangle

Overrides ThemedFormBehavior.MenuBounds

ScrollbarSizingGripBounds

Gets the bounding rectangle of the sizing grip that appears when both scrollbars are visible.

Declaration

cs-api-definition
protected virtual Rectangle ScrollbarSizingGripBounds { get; }

Property Value

Rectangle

SystemButtonsBounds

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

Declaration

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

Property Value

Rectangle

Overrides ThemedFormBehavior.SystemButtonsBounds

VerticalScrollbarBounds

Gets the bounding rectangle of the vertical scrollbar. Returns an empty rectangle if the scrollbar is not visible.

Declaration

cs-api-definition
protected virtual Rectangle VerticalScrollbarBounds { get; }

Property Value

Rectangle

Methods

AdjustFormElementForCurrentStyles()

This method adjusts the FormElement according to the styles currently applied to the Form. For example, the MinimizeButton, MaximizeButton and CloseButton in the Title Bar are enabled/disabled according to whether the corresponding window style is applied.

Declaration

cs-api-definition
protected void AdjustFormElementForCurrentStyles()

AdjustFormElementForFormState(int?)

Changes the visibility of the separate items within the RadFormElement's element tree according to the current Form state.

Declaration

cs-api-definition
protected void AdjustFormElementForFormState(int? formState)

Parameters

formState

int?

The state of the Form as it comes from the WM_SIZE message

CalculateDynamicClientMargin()

Calculates the client margin based on the current form and form element settings

Declaration

cs-api-definition
public virtual Padding CalculateDynamicClientMargin()

Returns

Padding

CreateChildItems(RadElement)

Declaration

cs-api-definition
public override void CreateChildItems(RadElement parent)

Parameters

parent

RadElement

Overrides FormControlBehavior.CreateChildItems(RadElement)

CreateFormElement()

Declaration

cs-api-definition
protected virtual RadFormElement CreateFormElement()

Returns

RadFormElement

CreateParams(CreateParams)

Declaration

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

Parameters

parameters

CreateParams

Returns

CreateParams

Overrides ThemedFormBehavior.CreateParams(CreateParams)

Dispose(bool)

Declaration

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

Parameters

disposing

bool

Overrides ThemedFormBehavior.Dispose(bool)

GetDynamicCaptionHeight()

Gets the Caption Height according to the Styles applied and the current state of the form.

Declaration

cs-api-definition
protected virtual int GetDynamicCaptionHeight()

Returns

int

A value representing the height of the caption.

GetWindowRealNCMargin()

Gets a Padding object which represents the window NC margin according to the currently set styles.

Declaration

cs-api-definition
protected virtual Padding GetWindowRealNCMargin()

Returns

Padding

The form NC margin.

HandleWndProc(ref Message)

Declaration

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

Parameters

m

Message

Returns

bool

Overrides ThemedFormBehavior.HandleWndProc(ref Message)

InvalidateElement(RadElement, Rectangle)

Declaration

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

Parameters

element

RadElement

bounds

Rectangle

Overrides ThemedFormBehavior.InvalidateElement(RadElement, Rectangle)

NCFromClientCoordinates(Point)

This method translates a point which is in client coordinates to a point in NC coordinates. Used when the Form has captured the mouse and NC mouse events have to be processed.

Declaration

cs-api-definition
protected virtual Point NCFromClientCoordinates(Point clientCoordinates)

Parameters

clientCoordinates

Point

A point in client coordinates.

Returns

Point

The point in NC coordinates.

OnActiveMDIChildTextChanged()

Declaration

cs-api-definition
protected override void OnActiveMDIChildTextChanged()

Overrides ThemedFormBehavior.OnActiveMDIChildTextChanged()

OnFormAssociated()

Fires when a Form has been associated with the behavior.

Declaration

cs-api-definition
protected override void OnFormAssociated()

Overrides ThemedFormBehavior.OnFormAssociated()

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 override 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

Overrides ThemedFormBehavior.OnWindowStateChanged(int, int)

SynchronizeHorizontalScrollbarState()

Calculates the bounding rectangle of the horizontal scrollbar.

Declaration

cs-api-definition
protected virtual Rectangle SynchronizeHorizontalScrollbarState()

Returns

Rectangle

An instance of the Rectangle struct that represents the position and the size of the horizontal scrollbar.

SynchronizeHorizontalScrollbarValues()

This method synchronizes the values of the standard horizontal scrollbar with the RadScrollBarElement in the Form's element hierarchy.

Declaration

cs-api-definition
protected virtual void SynchronizeHorizontalScrollbarValues()

SynchronizeScrollbarsValues()

Declaration

cs-api-definition
protected void SynchronizeScrollbarsValues()

SynchronizeVerticalScrollbarState()

Calculates the bounding rectangle of the vertical scrollbar.

Declaration

cs-api-definition
protected virtual Rectangle SynchronizeVerticalScrollbarState()

Returns

Rectangle

An instance of the Rectangle struct that represents the position and the size of the vertical scrollbar

SynchronizeVerticalScrollbarValues()

This method synchronizes the values of the standard vertical scrollbar with the RadScrollBarElement in the Form's element hierarchy.

Declaration

cs-api-definition
protected virtual void SynchronizeVerticalScrollbarValues()