Class
RadRibbonFormBehavior

Provides specialized behavior for RadRibbonForm instances, managing non-client area interaction, composition effects, and integration with RadRibbonBar controls.

Definition

Namespace:Telerik.WinControls.UI

Assembly:Telerik.WinControls.UI.dll

Syntax:

cs-api-definition
public class RadRibbonFormBehavior : RadNonClientUIBaseFormBehavior<RadRibbonBar>, IComponent, IDisposable

Inheritance: objectMarshalByRefObjectComponentFormControlBehaviorThemedFormBehaviorRadNonClientUIBaseFormBehavior<RadRibbonBar>RadRibbonFormBehavior

Implements: IComponentIDisposable

Inherited Members RadNonClientUIBaseFormBehavior<RadRibbonBar>.RegionHeightEllipseRadNonClientUIBaseFormBehavior<RadRibbonBar>.MaxFormBorderHeightRadNonClientUIBaseFormBehavior<RadRibbonBar>.capturedNCItemRadNonClientUIBaseFormBehavior<RadRibbonBar>.Dispose(bool)RadNonClientUIBaseFormBehavior<RadRibbonBar>.CreateChildItems(RadElement)RadNonClientUIBaseFormBehavior<RadRibbonBar>.CreateParams(CreateParams)RadNonClientUIBaseFormBehavior<RadRibbonBar>.HandleWndProc(ref Message)RadNonClientUIBaseFormBehavior<RadRibbonBar>.CanHandleParentNotify(ref Message)RadNonClientUIBaseFormBehavior<RadRibbonBar>.OnWmParentNotifyInDesigner(ref Message)RadNonClientUIBaseFormBehavior<RadRibbonBar>.OnWMNCRightButtonUp(ref Message)RadNonClientUIBaseFormBehavior<RadRibbonBar>.AdjustSystemButtonsForStyle()RadNonClientUIBaseFormBehavior<RadRibbonBar>.AdjustFormIconVisibility()RadNonClientUIBaseFormBehavior<RadRibbonBar>.OnWmSetIcon(ref Message)RadNonClientUIBaseFormBehavior<RadRibbonBar>.OnWmSetText(ref Message)RadNonClientUIBaseFormBehavior<RadRibbonBar>.OnGetMinMaxInfo(MinMaxInfo)RadNonClientUIBaseFormBehavior<RadRibbonBar>.OnActiveMDIChildTextChanged()RadNonClientUIBaseFormBehavior<RadRibbonBar>.FormHandleCreated()RadNonClientUIBaseFormBehavior<RadRibbonBar>.OnAssociatedFormPaintBackground(PaintEventArgs)RadNonClientUIBaseFormBehavior<RadRibbonBar>.OnFormAssociated()RadNonClientUIBaseFormBehavior<RadRibbonBar>.Form_Load(object, EventArgs)RadNonClientUIBaseFormBehavior<RadRibbonBar>.Form_ControlAdded(object, ControlEventArgs)RadNonClientUIBaseFormBehavior<RadRibbonBar>.NCFromClientCoordinates(Point)RadNonClientUIBaseFormBehavior<RadRibbonBar>.ExtendFrameIntoClientArea()RadNonClientUIBaseFormBehavior<RadRibbonBar>.ResetFormRegion()RadNonClientUIBaseFormBehavior<RadRibbonBar>.NonClientUIControlRadNonClientUIBaseFormBehavior<RadRibbonBar>.FormElementRadNonClientUIBaseFormBehavior<RadRibbonBar>.CaptionHeightRadNonClientUIBaseFormBehavior<RadRibbonBar>.CompositionEffectsEnabledRadNonClientUIBaseFormBehavior<RadRibbonBar>.CompositionEnabledRadNonClientUIBaseFormBehavior<RadRibbonBar>.AllowThemingRadNonClientUIBaseFormBehavior<RadRibbonBar>.MenuBoundsRadNonClientUIBaseFormBehavior<RadRibbonBar>.IconBoundsRadNonClientUIBaseFormBehavior<RadRibbonBar>.CaptionTextBoundsRadNonClientUIBaseFormBehavior<RadRibbonBar>.SystemButtonsBoundsThemedFormBehavior.GetMappedWindowPoint(Point)ThemedFormBehavior.GetMaximumFormHeightAccordingToCurrentScreen()ThemedFormBehavior.OnWindowStateChanged(int, int)ThemedFormBehavior.RefreshNC()ThemedFormBehavior.InvalidateNC(Rectangle)ThemedFormBehavior.OnNCPaint(Graphics)ThemedFormBehavior.PaintElement(IGraphics, Rectangle, VisualElement)ThemedFormBehavior.InvalidateElement(RadElement, Rectangle)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.CallBaseWndProc(ref Message)FormControlBehavior.CallDefWndProc(ref Message)FormControlBehavior.OnAssociatedFormPaint(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

RadRibbonFormBehavior()

Initializes a new instance of the RadRibbonFormBehavior class with default settings.

Declaration

cs-api-definition
public RadRibbonFormBehavior()

RadRibbonFormBehavior(IComponentTreeHandler)

Initializes a new instance of the RadRibbonFormBehavior class with the specified component tree handler.

Declaration

cs-api-definition
public RadRibbonFormBehavior(IComponentTreeHandler treeHandler)

Parameters

treeHandler

IComponentTreeHandler

The IComponentTreeHandler implementation that this behavior will be associated with.

RadRibbonFormBehavior(IComponentTreeHandler, bool)

Initializes a new instance of the RadRibbonFormBehavior class with the specified component tree handler and child item creation handling configuration.

Declaration

cs-api-definition
public RadRibbonFormBehavior(IComponentTreeHandler treeHandler, bool shouldHandleCreateChildItems)

Parameters

treeHandler

IComponentTreeHandler

The IComponentTreeHandler implementation that this behavior will be associated with.

shouldHandleCreateChildItems

bool

Determines whether this behavior should handle the CreateChildItems call for element hierarchy creation.

Properties

BorderWidth

Gets the border width thickness for the ribbon form, derived from the form element's border settings.

Declaration

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

Property Value

Padding

A Padding structure representing the thickness of the form's borders on all sides. This value is used for client area calculations and composition effect management.

Overrides FormControlBehavior.BorderWidth

ClientMargin

Gets the client margin for the form, with special handling for minimized MDI child windows.

Declaration

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

Property Value

Padding

A Padding structure representing the margins between the form's edges and its client area. For minimized MDI children, the top margin is set to the form's height to effectively hide the client area.

Overrides RadNonClientUIBaseFormBehavior<RadRibbonBar>.ClientMargin

RibbonBar

Gets the RadRibbonBar control that is hosted within this form's non-client area.

Declaration

cs-api-definition
protected virtual RadRibbonBar RibbonBar { get; }

Property Value

RadRibbonBar

The RadRibbonBar instance that serves as the primary UI control for this form, providing ribbon functionality and integration with the form's title bar.

TopCompositionMargin

Gets the top composition margin for DWM (Desktop Window Manager) glass effects, calculating the appropriate height based on window state and ribbon caption size.

Declaration

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

Property Value

int

An integer representing the top margin in pixels that should be extended into the client area for glass composition effects. The value varies based on whether the window is maximized and whether a ribbon control is present.

Overrides RadNonClientUIBaseFormBehavior<RadRibbonBar>.TopCompositionMargin

Methods

AdjustBehaviorForCompositionSate()

Adjusts the behavior configuration based on the current composition state, managing form element visibility, ribbon bar composition settings, and form shape properties.

Declaration

cs-api-definition
protected override void AdjustBehaviorForCompositionSate()

Overrides RadNonClientUIBaseFormBehavior<RadRibbonBar>.AdjustBehaviorForCompositionSate()

AdjustFormElementForFormState(int?)

Adjusts the form element configuration based on the specified window state, managing visibility and properties of form elements for different window states.

Declaration

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

Parameters

formState

int?

The window state constant indicating the new form state (SIZE_MAXIMIZED, SIZE_RESTORED, SIZE_MINIMIZED).

Overrides RadNonClientUIBaseFormBehavior<RadRibbonBar>.AdjustFormElementForFormState(int?)

CanHandleWndProc()

Determines whether this behavior can handle window procedure messages based on theming state and MDI configuration.

Declaration

cs-api-definition
protected override bool CanHandleWndProc()

Returns

bool

False if theming is allowed and the form is an MDI child; otherwise, true.

Overrides RadNonClientUIBaseFormBehavior<RadRibbonBar>.CanHandleWndProc()

CreateFormElement()

Creates and returns the form element that will represent the visual hierarchy for the ribbon form.

Declaration

cs-api-definition
protected override RadElement CreateFormElement()

Returns

RadElement

A new instance of RibbonFormElement that will manage the form's visual representation.

Overrides RadNonClientUIBaseFormBehavior<RadRibbonBar>.CreateFormElement()

DisposeNonClientUIControlImpls()

Performs cleanup of non-client UI control implementations, including disposal of ribbon form-specific menu strips.

Declaration

cs-api-definition
protected override void DisposeNonClientUIControlImpls()

Overrides RadNonClientUIBaseFormBehavior<RadRibbonBar>.DisposeNonClientUIControlImpls()

Form_SizeChanged(object, EventArgs)

Handles form size change events to manage composition effects, window state synchronization, and form region adjustments based on the current window state and composition settings.

Declaration

cs-api-definition
protected override void Form_SizeChanged(object sender, EventArgs e)

Parameters

sender

object

The source of the event, typically the form.

e

EventArgs

An EventArgs that contains no event data.

Overrides RadNonClientUIBaseFormBehavior<RadRibbonBar>.Form_SizeChanged(object, EventArgs)

InitializeDummyMenuStrip()

Initializes a dummy menu strip for the form if none exists, ensuring proper integration with Windows menu handling.

Declaration

cs-api-definition
protected override void InitializeDummyMenuStrip()

Overrides RadNonClientUIBaseFormBehavior<RadRibbonBar>.InitializeDummyMenuStrip()

InitializeNonClientUIControl()

Initializes the non-client UI control by locating and configuring the first RadRibbonBar control found in the form's control collection.

Declaration

cs-api-definition
protected override void InitializeNonClientUIControl()

Overrides RadNonClientUIBaseFormBehavior<RadRibbonBar>.InitializeNonClientUIControl()

IsApplicationMenu()

Determines whether the current ribbon configuration uses an application menu style that supports traditional menu behavior.

Declaration

cs-api-definition
protected override bool IsApplicationMenu()

Returns

bool

True if the application menu style is not BackstageView; otherwise, false.

Overrides RadNonClientUIBaseFormBehavior<RadRibbonBar>.IsApplicationMenu()

OnWMActivateCore(ref Message)

Handles WM_ACTIVATE messages to manage form activation states and synchronize ribbon control and form element active states for proper visual feedback.

Declaration

cs-api-definition
protected override void OnWMActivateCore(ref Message m)

Parameters

m

Message

The Windows message containing activation state information.

Overrides RadNonClientUIBaseFormBehavior<RadRibbonBar>.OnWMActivateCore(ref Message)

OnWmMDIActivate(ref Message)

Handles WM_MDIACTIVATE messages for MDI child window activation, managing form active state properties and calling the base window procedure for proper MDI behavior.

Declaration

cs-api-definition
protected override bool OnWmMDIActivate(ref Message m)

Parameters

m

Message

The Windows message containing MDI activation information.

Returns

bool

True if the message was handled; otherwise, false.

Overrides RadNonClientUIBaseFormBehavior<RadRibbonBar>.OnWmMDIActivate(ref Message)

OnWmNCLeftMouseButtonDown(ref Message)

Handles WM_NCLBUTTONDOWN messages to process non-client area left mouse button down events, determining whether to allow default window behavior or handle custom ribbon interactions.

Declaration

cs-api-definition
protected override void OnWmNCLeftMouseButtonDown(ref Message m)

Parameters

m

Message

The Windows message containing mouse position and button state information.

Overrides RadNonClientUIBaseFormBehavior<RadRibbonBar>.OnWmNCLeftMouseButtonDown(ref Message)

OnWmNCLeftMouseButtonUp(ref Message)

Handles WM_NCLBUTTONUP messages to process non-client area left mouse button up events, managing system commands for window operations and application icon interactions.

Declaration

cs-api-definition
protected override void OnWmNCLeftMouseButtonUp(ref Message m)

Parameters

m

Message

The Windows message containing mouse position and button state information.

Overrides RadNonClientUIBaseFormBehavior<RadRibbonBar>.OnWmNCLeftMouseButtonUp(ref Message)

UpdateFormForThemingState(bool)

Updates the form's configuration for the specified theming state, adjusting composition effects and applying necessary style updates.

Declaration

cs-api-definition
protected override void UpdateFormForThemingState(bool showAero)

Parameters

showAero

bool

True to enable Aero composition effects; false to disable them.

Overrides RadNonClientUIBaseFormBehavior<RadRibbonBar>.UpdateFormForThemingState(bool)

UpdateMDIButtonsAndCaptionText()

Updates MDI button visibility and caption text synchronization between the form and ribbon control.

Declaration

cs-api-definition
protected override void UpdateMDIButtonsAndCaptionText()

Overrides RadNonClientUIBaseFormBehavior<RadRibbonBar>.UpdateMDIButtonsAndCaptionText()

UpdateNCComposition()

Updates the composition settings of the non-client UI control to match the current behavior state.

Declaration

cs-api-definition
protected override void UpdateNCComposition()

Overrides RadNonClientUIBaseFormBehavior<RadRibbonBar>.UpdateNCComposition()