New to Telerik UI for WinFormsStart a free 30-day trial

A standard behavior for RadForm.

Definition

Namespace:Telerik.WinControls.UI

Assembly:Telerik.WinControls.UI.dll

Syntax:

C#
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

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

C#
public RadFormBehavior()

Creates an instance of the RadFormBehavior class.

C#
public RadFormBehavior(IComponentTreeHandler treeHandler, bool shouldCreateChildren)
Parameters:treeHandlerIComponentTreeHandler

An IComponentTreeHandler instance.

shouldCreateChildrenbool

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

Creates an instance of the RadFormBehavior class.

C#
public RadFormBehavior(IComponentTreeHandler treeHandler)
Parameters:treeHandlerIComponentTreeHandler

An IComponentTreeHandler instance.

Properties

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.

C#
public override bool AllowTheming { get; set; }

Overrides: ThemedFormBehavior.AllowTheming

Gets the Border width of the Form.

C#
public override Padding BorderWidth { get; }

Overrides: FormControlBehavior.BorderWidth

Gets the Caption Height of the Form.

C#
public override int CaptionHeight { get; }

Overrides: FormControlBehavior.CaptionHeight

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

C#
public override Rectangle CaptionTextBounds { get; }

Overrides: ThemedFormBehavior.CaptionTextBounds

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

C#
public override Padding ClientMargin { get; }

Overrides: FormControlBehavior.ClientMargin

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

C#
public override RadElement FormElement { get; }

Overrides: FormControlBehavior.FormElement

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

C#
protected virtual Rectangle HorizontalScrollbarBounds { get; }

Gets the rectangle that contains the form's icon.

C#
public override Rectangle IconBounds { get; }

Overrides: ThemedFormBehavior.IconBounds

Gets the rectangle that contains the menu of the form.

C#
public override Rectangle MenuBounds { get; }

Overrides: ThemedFormBehavior.MenuBounds

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

C#
protected virtual Rectangle ScrollbarSizingGripBounds { get; }

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

C#
public override Rectangle SystemButtonsBounds { get; }

Overrides: ThemedFormBehavior.SystemButtonsBounds

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

C#
protected virtual Rectangle VerticalScrollbarBounds { get; }

Methods

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.

C#
protected void AdjustFormElementForCurrentStyles()

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

C#
protected void AdjustFormElementForFormState(int? formState)
Parameters:formStateint?

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

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

C#
public virtual Padding CalculateDynamicClientMargin()
Returns:

Padding

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

Overrides: FormControlBehavior.CreateChildItems(RadElement)

C#
protected virtual RadFormElement CreateFormElement()
Returns:

RadFormElement

C#
public override CreateParams CreateParams(CreateParams parameters)
Parameters:parametersCreateParamsReturns:

CreateParams

Overrides: ThemedFormBehavior.CreateParams(CreateParams)

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

Overrides: ThemedFormBehavior.Dispose(bool)

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

C#
protected virtual int GetDynamicCaptionHeight()
Returns:

int

A value representing the height of the caption.

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

C#
protected virtual Padding GetWindowRealNCMargin()
Returns:

Padding

The form NC margin.

C#
public override bool HandleWndProc(ref Message m)
Parameters:mMessageReturns:

bool

Overrides: ThemedFormBehavior.HandleWndProc(ref Message)

C#
public override void InvalidateElement(RadElement element, Rectangle bounds)
Parameters:elementRadElementboundsRectangle

Overrides: ThemedFormBehavior.InvalidateElement(RadElement, Rectangle)

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.

C#
protected virtual Point NCFromClientCoordinates(Point clientCoordinates)
Parameters:clientCoordinatesPoint

A point in client coordinates.

Returns:

Point

The point in NC coordinates.

C#
protected override void OnActiveMDIChildTextChanged()

Overrides: ThemedFormBehavior.OnActiveMDIChildTextChanged()

Fires when a Form has been associated with the behavior.

C#
protected override void OnFormAssociated()

Overrides: ThemedFormBehavior.OnFormAssociated()

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

C#
protected override void OnWindowStateChanged(int currentFormState, int newFormState)
Parameters:currentFormStateint

The old window state of the form.

newFormStateint

The new window state of the form

Overrides: ThemedFormBehavior.OnWindowStateChanged(int, int)

Calculates the bounding rectangle of the horizontal scrollbar.

C#
protected virtual Rectangle SynchronizeHorizontalScrollbarState()
Returns:

Rectangle

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

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

C#
protected virtual void SynchronizeHorizontalScrollbarValues()
C#
protected void SynchronizeScrollbarsValues()

Calculates the bounding rectangle of the vertical scrollbar.

C#
protected virtual Rectangle SynchronizeVerticalScrollbarState()
Returns:

Rectangle

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

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

C#
protected virtual void SynchronizeVerticalScrollbarValues()