skip navigation
  • Product Bundles

    DevCraft

    All Telerik .NET tools and Kendo UI JavaScript components in one package. Now enhanced with:

    • AI Coding Assistants
    • Embedded Reporting
    • Document Processing Libraries
    • SSO Account Sign-in

    Web

    Kendo UI UI for Angular UI for Vue UI for jQuery KendoReact UI for Blazor UI for ASP.NET Core UI for ASP.NET MVC UI for ASP.NET AJAX

    Mobile

    UI for .NET MAUI

    Document Management

    Telerik Document Processing

    Desktop

    UI for .NET MAUI UI for WinUI UI for WinForms UI for WPF

    Reporting

    Telerik Reporting Telerik Report Server

    Testing & Mocking

    Test Studio Telerik JustMock

    CMS

    Sitefinity

    AI Productivity Tools

    AI Coding Assistants

    UI/UX Tools

    ThemeBuilder Design System Kit Templates and Building Blocks

    Debugging

    Fiddler Fiddler Everywhere Fiddler Classic Fiddler Everywhere Reporter FiddlerCore

    Free Tools

    KendoReact Free VB.NET to C# Converter Testing Framework
    View all products
  • Overview
  • Demos
    • What's New
    • Roadmap
    • Release History
  • Support and Learning

    • Support and Learning Hub
    • First Steps
    • Docs
    • Demos
    • Virtual Classroom
    • Forums
    • Videos
    • Blogs
    • Accessibility
    • Submit a Ticket

    Productivity and Design Tools

    • Visual Studio Extensions
    • Visual Studio Templates
    • Embedded Reporting
  • Pricing
  • Shopping cart
    • Account Overview
    • Your Licenses
    • Downloads
    • Support Center
    • Forum Profile
    • Payment Methods
    • Edit Profile
    • Log out
  • Login
  • Contact Us
  • Try now

Class RadRibbonFormBehavior

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

Inheritance
System.Object
FormControlBehavior
ThemedFormBehavior
RadNonClientUIBaseFormBehavior<RadRibbonBar>
RadRibbonFormBehavior
Inherited Members
RadNonClientUIBaseFormBehavior<RadRibbonBar>.RegionHeightEllipse
RadNonClientUIBaseFormBehavior<RadRibbonBar>.MaxFormBorderHeight
RadNonClientUIBaseFormBehavior<RadRibbonBar>.capturedNCItem
RadNonClientUIBaseFormBehavior<RadRibbonBar>.Dispose(Boolean)
RadNonClientUIBaseFormBehavior<RadRibbonBar>.CreateChildItems(RadElement)
RadNonClientUIBaseFormBehavior<RadRibbonBar>.CreateParams(CreateParams)
RadNonClientUIBaseFormBehavior<RadRibbonBar>.HandleWndProc(Message)
RadNonClientUIBaseFormBehavior<RadRibbonBar>.CanHandleParentNotify(Message)
RadNonClientUIBaseFormBehavior<RadRibbonBar>.OnWmParentNotifyInDesigner(Message)
RadNonClientUIBaseFormBehavior<RadRibbonBar>.OnWMNCRightButtonUp(Message)
RadNonClientUIBaseFormBehavior<RadRibbonBar>.AdjustSystemButtonsForStyle()
RadNonClientUIBaseFormBehavior<RadRibbonBar>.AdjustFormIconVisibility()
RadNonClientUIBaseFormBehavior<RadRibbonBar>.OnWmSetIcon(Message)
RadNonClientUIBaseFormBehavior<RadRibbonBar>.OnWmSetText(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>.NonClientUIControl
RadNonClientUIBaseFormBehavior<RadRibbonBar>.FormElement
RadNonClientUIBaseFormBehavior<RadRibbonBar>.CaptionHeight
RadNonClientUIBaseFormBehavior<RadRibbonBar>.CompositionEffectsEnabled
RadNonClientUIBaseFormBehavior<RadRibbonBar>.CompositionEnabled
RadNonClientUIBaseFormBehavior<RadRibbonBar>.AllowTheming
RadNonClientUIBaseFormBehavior<RadRibbonBar>.MenuBounds
RadNonClientUIBaseFormBehavior<RadRibbonBar>.IconBounds
RadNonClientUIBaseFormBehavior<RadRibbonBar>.CaptionTextBounds
RadNonClientUIBaseFormBehavior<RadRibbonBar>.SystemButtonsBounds
ThemedFormBehavior.GetMappedWindowPoint(Point)
ThemedFormBehavior.GetMaximumFormHeightAccordingToCurrentScreen()
ThemedFormBehavior.OnWindowStateChanged(Int32, Int32)
ThemedFormBehavior.RefreshNC()
ThemedFormBehavior.InvalidateNC(Rectangle)
ThemedFormBehavior.OnNCPaint(Graphics)
ThemedFormBehavior.PaintElement(IGraphics, Rectangle, VisualElement)
ThemedFormBehavior.InvalidateElement(RadElement, Rectangle)
ThemedFormBehavior.IsMaximized
ThemedFormBehavior.IsMinimized
ThemedFormBehavior.IsNormal
ThemedFormBehavior.CurrentFormState
ThemedFormBehavior.IsMdiChildMaximized
ThemedFormBehavior.FormMdiClient
ThemedFormBehavior.IsMenuInForm
ThemedFormBehavior.MainMenuInForm
ThemedFormBehavior.MaximizedMDIChild
ThemedFormBehavior.TopResizeFrame
ThemedFormBehavior.TopLeftResizeFrame
ThemedFormBehavior.LeftResizeFrame
ThemedFormBehavior.BottomLeftResizeFrame
ThemedFormBehavior.BottomResizeFrame
ThemedFormBehavior.BottomRightResizeFrame
ThemedFormBehavior.RightResizeFrame
ThemedFormBehavior.TopRightResizeFrame
ThemedFormBehavior.CaptionFrame
ThemedFormBehavior.LeftBorderFrame
ThemedFormBehavior.BottomBorderFrame
ThemedFormBehavior.RightBorderFrame
ThemedFormBehavior.ClientFrame
ThemedFormBehavior.CurrentFormParams
ThemedFormBehavior.Form
FormControlBehavior.targetHandler
FormControlBehavior.CallBaseWndProc(Message)
FormControlBehavior.CallDefWndProc(Message)
FormControlBehavior.OnAssociatedFormPaint(PaintEventArgs)
Namespace: Telerik.WinControls.UI
Assembly: Telerik.WinControls.UI.dll

Syntax

public class RadRibbonFormBehavior : RadNonClientUIBaseFormBehavior<RadRibbonBar>
Remarks

RadRibbonFormBehavior extends RadNonClientUIBaseFormBehavior<T> to provide complete management of ribbon form functionality including Window composition effects, form state handling, mouse interaction processing, and seamless integration between the form's non-client area and the hosted ribbon control.

This behavior handles complex scenarios such as MDI child window management, system button interaction, window state changes, and proper composition effect management for both Aero and non-Aero environments. It coordinates between the form's title bar elements and the ribbon bar's caption area to provide a unified Office-style user experience.

The class manages window message processing for mouse events, activation states, size changes, and MDI operations while maintaining proper visual feedback and state synchronization between the form and its hosted ribbon control.

Constructors

RadRibbonFormBehavior()

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

Declaration
public RadRibbonFormBehavior()

RadRibbonFormBehavior(IComponentTreeHandler)

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

Declaration
public RadRibbonFormBehavior(IComponentTreeHandler treeHandler)
Parameters
IComponentTreeHandler treeHandler

The IComponentTreeHandler implementation that this behavior will be associated with.

RadRibbonFormBehavior(IComponentTreeHandler, Boolean)

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

Declaration
public RadRibbonFormBehavior(IComponentTreeHandler treeHandler, bool shouldHandleCreateChildItems)
Parameters
IComponentTreeHandler treeHandler

The IComponentTreeHandler implementation that this behavior will be associated with.

System.Boolean shouldHandleCreateChildItems

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
public override Padding BorderWidth { get; }
Property Value
System.Windows.Forms.Padding

A System.Windows.Forms.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
public override Padding ClientMargin { get; }
Property Value
System.Windows.Forms.Padding

A System.Windows.Forms.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
Telerik.WinControls.UI.RadNonClientUIBaseFormBehavior<Telerik.WinControls.UI.RadRibbonBar>.ClientMargin

RibbonBar

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

Declaration
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
public override int TopCompositionMargin { get; }
Property Value
System.Int32

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
Telerik.WinControls.UI.RadNonClientUIBaseFormBehavior<Telerik.WinControls.UI.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
protected override void AdjustBehaviorForCompositionSate()
Overrides
Telerik.WinControls.UI.RadNonClientUIBaseFormBehavior<Telerik.WinControls.UI.RadRibbonBar>.AdjustBehaviorForCompositionSate()

AdjustFormElementForFormState(Nullable<Int32>)

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

Declaration
protected override void AdjustFormElementForFormState(int? formState)
Parameters
System.Nullable<System.Int32> formState

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

Overrides
Telerik.WinControls.UI.RadNonClientUIBaseFormBehavior<Telerik.WinControls.UI.RadRibbonBar>.AdjustFormElementForFormState(System.Nullable<System.Int32>)

CanHandleWndProc()

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

Declaration
protected override bool CanHandleWndProc()
Returns
System.Boolean

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

Overrides
Telerik.WinControls.UI.RadNonClientUIBaseFormBehavior<Telerik.WinControls.UI.RadRibbonBar>.CanHandleWndProc()

CreateFormElement()

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

Declaration
protected override RadElement CreateFormElement()
Returns
RadElement

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

Overrides
Telerik.WinControls.UI.RadNonClientUIBaseFormBehavior<Telerik.WinControls.UI.RadRibbonBar>.CreateFormElement()

DisposeNonClientUIControlImpls()

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

Declaration
protected override void DisposeNonClientUIControlImpls()
Overrides
Telerik.WinControls.UI.RadNonClientUIBaseFormBehavior<Telerik.WinControls.UI.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
protected override void Form_SizeChanged(object sender, EventArgs e)
Parameters
System.Object sender

The source of the event, typically the form.

System.EventArgs e

An System.EventArgs that contains no event data.

Overrides
Telerik.WinControls.UI.RadNonClientUIBaseFormBehavior<Telerik.WinControls.UI.RadRibbonBar>.Form_SizeChanged(System.Object, System.EventArgs)

InitializeDummyMenuStrip()

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

Declaration
protected override void InitializeDummyMenuStrip()
Overrides
Telerik.WinControls.UI.RadNonClientUIBaseFormBehavior<Telerik.WinControls.UI.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
protected override void InitializeNonClientUIControl()
Overrides
Telerik.WinControls.UI.RadNonClientUIBaseFormBehavior<Telerik.WinControls.UI.RadRibbonBar>.InitializeNonClientUIControl()

IsApplicationMenu()

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

Declaration
protected override bool IsApplicationMenu()
Returns
System.Boolean

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

Overrides
Telerik.WinControls.UI.RadNonClientUIBaseFormBehavior<Telerik.WinControls.UI.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
protected override void OnWMActivateCore(ref Message m)
Parameters
System.Windows.Forms.Message m

The Windows message containing activation state information.

Overrides
Telerik.WinControls.UI.RadNonClientUIBaseFormBehavior<Telerik.WinControls.UI.RadRibbonBar>.OnWMActivateCore(System.Windows.Forms.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
protected override bool OnWmMDIActivate(ref Message m)
Parameters
System.Windows.Forms.Message m

The Windows message containing MDI activation information.

Returns
System.Boolean

True if the message was handled; otherwise, false.

Overrides
Telerik.WinControls.UI.RadNonClientUIBaseFormBehavior<Telerik.WinControls.UI.RadRibbonBar>.OnWmMDIActivate(System.Windows.Forms.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
protected override void OnWmNCLeftMouseButtonDown(ref Message m)
Parameters
System.Windows.Forms.Message m

The Windows message containing mouse position and button state information.

Overrides
Telerik.WinControls.UI.RadNonClientUIBaseFormBehavior<Telerik.WinControls.UI.RadRibbonBar>.OnWmNCLeftMouseButtonDown(System.Windows.Forms.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
protected override void OnWmNCLeftMouseButtonUp(ref Message m)
Parameters
System.Windows.Forms.Message m

The Windows message containing mouse position and button state information.

Overrides
Telerik.WinControls.UI.RadNonClientUIBaseFormBehavior<Telerik.WinControls.UI.RadRibbonBar>.OnWmNCLeftMouseButtonUp(System.Windows.Forms.Message)

UpdateFormForThemingState(Boolean)

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

Declaration
protected override void UpdateFormForThemingState(bool showAero)
Parameters
System.Boolean showAero

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

Overrides
Telerik.WinControls.UI.RadNonClientUIBaseFormBehavior<Telerik.WinControls.UI.RadRibbonBar>.UpdateFormForThemingState(System.Boolean)

UpdateMDIButtonsAndCaptionText()

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

Declaration
protected override void UpdateMDIButtonsAndCaptionText()
Overrides
Telerik.WinControls.UI.RadNonClientUIBaseFormBehavior<Telerik.WinControls.UI.RadRibbonBar>.UpdateMDIButtonsAndCaptionText()

UpdateNCComposition()

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

Declaration
protected override void UpdateNCComposition()
Overrides
Telerik.WinControls.UI.RadNonClientUIBaseFormBehavior<Telerik.WinControls.UI.RadRibbonBar>.UpdateNCComposition()

Extension Methods

SvgExtentions.Traverse<T>(T, Func<T, IEnumerable<T>>)
SvgExtentions.TraverseDepthFirst<T>(T, Func<T, IEnumerable<T>>)
Getting Started
  • Install Now
  • Demos
  • Step-by-Step Tutorial
  • Sample Applications
  • SDK Samples
  • Visual Studio Extensions
Support Resources
  • Code Library
  • Knowledge Base
  • Videos
Community
  • Forums
  • Blogs
  • Feedback Portal
  • Document Processing Feedback Portal

Copyright © 2018 Progress Software Corporation and/or its subsidiaries or affiliates.
All Rights Reserved.

Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks for appropriate markings.