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

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:

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

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

C#
public RadRibbonFormBehavior()

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

C#
public RadRibbonFormBehavior(IComponentTreeHandler treeHandler, bool shouldHandleCreateChildItems)
Parameters:treeHandlerIComponentTreeHandler

The IComponentTreeHandler implementation that this behavior will be associated with.

shouldHandleCreateChildItemsbool

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

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

C#
public RadRibbonFormBehavior(IComponentTreeHandler treeHandler)
Parameters:treeHandlerIComponentTreeHandler

The IComponentTreeHandler implementation that this behavior will be associated with.

Properties

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

C#
public override Padding BorderWidth { get; }
Property Value:

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

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

C#
public override Padding ClientMargin { get; }
Property Value:

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

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

C#
protected virtual RadRibbonBar RibbonBar { get; }
Property Value:

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

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

C#
public override int TopCompositionMargin { get; }
Property Value:

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

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

C#
protected override void AdjustBehaviorForCompositionSate()

Overrides: RadNonClientUIBaseFormBehavior<RadRibbonBar>.AdjustBehaviorForCompositionSate()

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

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

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

Overrides: RadNonClientUIBaseFormBehavior<RadRibbonBar>.AdjustFormElementForFormState(int?)

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

C#
protected override bool CanHandleWndProc()
Returns:

bool

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

Overrides: RadNonClientUIBaseFormBehavior<RadRibbonBar>.CanHandleWndProc()

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

C#
protected override RadElement CreateFormElement()
Returns:

RadElement

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

Overrides: RadNonClientUIBaseFormBehavior<RadRibbonBar>.CreateFormElement()

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

C#
protected override void DisposeNonClientUIControlImpls()

Overrides: RadNonClientUIBaseFormBehavior<RadRibbonBar>.DisposeNonClientUIControlImpls()

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.

C#
protected override void Form_SizeChanged(object sender, EventArgs e)
Parameters:senderobject

The source of the event, typically the form.

eEventArgs

An EventArgs that contains no event data.

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

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

C#
protected override void InitializeDummyMenuStrip()

Overrides: RadNonClientUIBaseFormBehavior<RadRibbonBar>.InitializeDummyMenuStrip()

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

C#
protected override void InitializeNonClientUIControl()

Overrides: RadNonClientUIBaseFormBehavior<RadRibbonBar>.InitializeNonClientUIControl()

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

C#
protected override bool IsApplicationMenu()
Returns:

bool

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

Overrides: RadNonClientUIBaseFormBehavior<RadRibbonBar>.IsApplicationMenu()

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

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

The Windows message containing activation state information.

Overrides: RadNonClientUIBaseFormBehavior<RadRibbonBar>.OnWMActivateCore(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.

C#
protected override bool OnWmMDIActivate(ref Message m)
Parameters:mMessage

The Windows message containing MDI activation information.

Returns:

bool

True if the message was handled; otherwise, false.

Overrides: RadNonClientUIBaseFormBehavior<RadRibbonBar>.OnWmMDIActivate(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.

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

The Windows message containing mouse position and button state information.

Overrides: RadNonClientUIBaseFormBehavior<RadRibbonBar>.OnWmNCLeftMouseButtonDown(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.

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

The Windows message containing mouse position and button state information.

Overrides: RadNonClientUIBaseFormBehavior<RadRibbonBar>.OnWmNCLeftMouseButtonUp(ref Message)

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

C#
protected override void UpdateFormForThemingState(bool showAero)
Parameters:showAerobool

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

Overrides: RadNonClientUIBaseFormBehavior<RadRibbonBar>.UpdateFormForThemingState(bool)

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

C#
protected override void UpdateMDIButtonsAndCaptionText()

Overrides: RadNonClientUIBaseFormBehavior<RadRibbonBar>.UpdateMDIButtonsAndCaptionText()

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

C#
protected override void UpdateNCComposition()

Overrides: RadNonClientUIBaseFormBehavior<RadRibbonBar>.UpdateNCComposition()