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 ThemedFormBehavior

This class represents a base class for all behaviors that modify the non-client area of the form and enable custom painting in it.

Inheritance
System.Object
FormControlBehavior
ThemedFormBehavior
RadFormBehavior
RadNonClientUIBaseFormBehavior<T>
Inherited Members
FormControlBehavior.targetHandler
FormControlBehavior.FormHandleCreated()
FormControlBehavior.CallBaseWndProc(Message)
FormControlBehavior.CallDefWndProc(Message)
FormControlBehavior.OnAssociatedFormPaint(PaintEventArgs)
FormControlBehavior.OnAssociatedFormPaintBackground(PaintEventArgs)
FormControlBehavior.CreateChildItems(RadElement)
FormControlBehavior.FormElement
FormControlBehavior.BorderWidth
FormControlBehavior.CaptionHeight
FormControlBehavior.ClientMargin
Namespace: Telerik.WinControls.UI
Assembly: Telerik.WinControls.UI.dll

Syntax

public abstract class ThemedFormBehavior : FormControlBehavior

Constructors

ThemedFormBehavior()

Creates an instance of the ThemedFormBehavior class.

Declaration
public ThemedFormBehavior()

ThemedFormBehavior(IComponentTreeHandler)

Creates an instance of the RadFormBehavior class.

Declaration
public ThemedFormBehavior(IComponentTreeHandler treeHandler)
Parameters
IComponentTreeHandler treeHandler

An IComponentTreeHandler instance.

ThemedFormBehavior(IComponentTreeHandler, Boolean)

Creates an instance of the RadFormBehavior class.

Declaration
public ThemedFormBehavior(IComponentTreeHandler treeHandler, bool shouldCreateChildren)
Parameters
IComponentTreeHandler treeHandler

An IComponentTreeHandler instance.

System.Boolean shouldCreateChildren

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

Properties

AllowTheming

Gets or sets a bool value indiciating whether the behavior applies NC theming to the form.

Declaration
public abstract bool AllowTheming { get; set; }
Property Value
System.Boolean

BottomBorderFrame

This rectangle represents the bottom border frame of a window.

Declaration
public virtual Rectangle BottomBorderFrame { get; }
Property Value
System.Drawing.Rectangle

BottomLeftResizeFrame

This rectangle represents the bottomleft sizing corner of a window.

Declaration
public virtual Rectangle BottomLeftResizeFrame { get; }
Property Value
System.Drawing.Rectangle

BottomResizeFrame

This rectangle represents the bottom sizing frame of a window.

Declaration
public virtual Rectangle BottomResizeFrame { get; }
Property Value
System.Drawing.Rectangle

BottomRightResizeFrame

This rectangle represents the bottomright sizing corner of a window.

Declaration
public virtual Rectangle BottomRightResizeFrame { get; }
Property Value
System.Drawing.Rectangle

CaptionFrame

This rectangle represents the caption frame of a window.

Declaration
public virtual Rectangle CaptionFrame { get; }
Property Value
System.Drawing.Rectangle

CaptionTextBounds

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

Declaration
public abstract Rectangle CaptionTextBounds { get; }
Property Value
System.Drawing.Rectangle

ClientFrame

This rectangle represents the client rectangle of a window.

Declaration
public virtual Rectangle ClientFrame { get; }
Property Value
System.Drawing.Rectangle

CurrentFormParams

Gets the current form CreateParams settings.

Declaration
public virtual CreateParams CurrentFormParams { get; }
Property Value
System.Windows.Forms.CreateParams

CurrentFormState

Gets an integer value that determines the current Form state: Possible values come from the SIZE_RESTORED, SIZE_MAXIMIZED, SIZE_MINIMIZED win32 constants.

Declaration
protected int CurrentFormState { get; }
Property Value
System.Int32

Form

Gets or sets the form associated with this behavior. Used only in design-time. IMPORTANT: This property can be assigned only one time. An InvalidOperationException is thrown when the property is assigned more than once.

Declaration
public RadFormControlBase Form { get; set; }
Property Value
RadFormControlBase

FormMdiClient

Gets the MdiClient control of the Form. Returns null if the Form is not MdiContainer.

Declaration
protected MdiClient FormMdiClient { get; }
Property Value
System.Windows.Forms.MdiClient

IconBounds

Gets the rectangle that contains the form's icon.

Declaration
public abstract Rectangle IconBounds { get; }
Property Value
System.Drawing.Rectangle

IsMaximized

Gets a bool value that determines whether the Form's window state is maximized.

Declaration
protected virtual bool IsMaximized { get; }
Property Value
System.Boolean

IsMdiChildMaximized

Gets a boolean value showing whether a MDI child form is maximized.

Declaration
protected virtual bool IsMdiChildMaximized { get; }
Property Value
System.Boolean

IsMenuInForm

Gets a boolean value determining whether there is a Menu in the Form.

Declaration
protected bool IsMenuInForm { get; }
Property Value
System.Boolean

IsMinimized

Gets a bool value that determines whether the Form's window state is minimized.

Declaration
protected virtual bool IsMinimized { get; }
Property Value
System.Boolean

IsNormal

Gets a boolean value that determines whether the Form's window state is normal.

Declaration
protected virtual bool IsNormal { get; }
Property Value
System.Boolean

LeftBorderFrame

This rectangle represents the left border frame of a window.

Declaration
public virtual Rectangle LeftBorderFrame { get; }
Property Value
System.Drawing.Rectangle

LeftResizeFrame

This rectangle represents the left sizing frame of a window.

Declaration
public virtual Rectangle LeftResizeFrame { get; }
Property Value
System.Drawing.Rectangle

MainMenuInForm

Declaration
protected RadMenu MainMenuInForm { get; }
Property Value
RadMenu

MaximizedMDIChild

Gets the maximized MDI child if any.

Declaration
protected Form MaximizedMDIChild { get; }
Property Value
System.Windows.Forms.Form

MenuBounds

Gets the rectangle that contains the menu of the form.

Declaration
public abstract Rectangle MenuBounds { get; }
Property Value
System.Drawing.Rectangle

RightBorderFrame

This rectangle represents the right border frame of a window.

Declaration
public virtual Rectangle RightBorderFrame { get; }
Property Value
System.Drawing.Rectangle

RightResizeFrame

This rectangle represents the right sizing frame of a window.

Declaration
public virtual Rectangle RightResizeFrame { get; }
Property Value
System.Drawing.Rectangle

SystemButtonsBounds

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

Declaration
public abstract Rectangle SystemButtonsBounds { get; }
Property Value
System.Drawing.Rectangle

TopLeftResizeFrame

This rectangle represents the topleft sizing corner of a window.

Declaration
public virtual Rectangle TopLeftResizeFrame { get; }
Property Value
System.Drawing.Rectangle

TopResizeFrame

This rectangle represents the top sizing frame of a window.

Declaration
public virtual Rectangle TopResizeFrame { get; }
Property Value
System.Drawing.Rectangle

TopRightResizeFrame

This rectangle represents the topright sizing corner of a window.

Declaration
public virtual Rectangle TopRightResizeFrame { get; }
Property Value
System.Drawing.Rectangle

Methods

CreateParams(CreateParams)

Declaration
public override CreateParams CreateParams(CreateParams parameters)
Parameters
System.Windows.Forms.CreateParams parameters

Returns
System.Windows.Forms.CreateParams

Overrides
FormControlBehavior.CreateParams(CreateParams)

Dispose(Boolean)

Declaration
protected override void Dispose(bool disposing)
Parameters
System.Boolean disposing

Overrides
FormControlBehavior.Dispose(Boolean)

GetMappedWindowPoint(Point)

This method transforms screen coordinates into local coordinates.

Declaration
protected virtual Point GetMappedWindowPoint(Point screenPoint)
Parameters
System.Drawing.Point screenPoint

The screen point to transform.

Returns
System.Drawing.Point

The transformed point. If the handle of the associated Form is not created, the method returns the input.

GetMaximumFormHeightAccordingToCurrentScreen()

This method returns the maximum available height according to the current position of the form in multi-monitor setup.

Declaration
protected int GetMaximumFormHeightAccordingToCurrentScreen()
Returns
System.Int32

HandleWndProc(ref Message)

Declaration
public override bool HandleWndProc(ref Message m)
Parameters
System.Windows.Forms.Message m

Returns
System.Boolean

Overrides
FormControlBehavior.HandleWndProc(ref Message)

InvalidateElement(RadElement, Rectangle)

Declaration
public override void InvalidateElement(RadElement element, Rectangle bounds)
Parameters
RadElement element

System.Drawing.Rectangle bounds

Overrides
FormControlBehavior.InvalidateElement(RadElement, Rectangle)

InvalidateNC(Rectangle)

Invalidates the specified bounds in the non-client area of the form this behavior is associated with.

Declaration
protected virtual void InvalidateNC(Rectangle bounds)
Parameters
System.Drawing.Rectangle bounds

OnActiveMDIChildTextChanged()

Declaration
protected virtual void OnActiveMDIChildTextChanged()

OnFormAssociated()

Declaration
protected override void OnFormAssociated()
Overrides
FormControlBehavior.OnFormAssociated()

OnGetMinMaxInfo(MinMaxInfo)

This event is fired when the WM_GETMINMAXINFO message is sent to the form.

Declaration
protected virtual void OnGetMinMaxInfo(MinMaxInfo minMaxInfo)
Parameters
MinMaxInfo minMaxInfo

Contains information about the position, maximum/minimum size of the form etc. Can be modified to adjust the settings applied to the form.

OnNCPaint(Graphics)

This event is fired when the WM_NCPAINT message is sent to the form.

Declaration
protected virtual void OnNCPaint(Graphics graphics)
Parameters
System.Drawing.Graphics graphics

The NC Graphics.

OnWindowStateChanged(Int32, Int32)

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

Declaration
protected virtual void OnWindowStateChanged(int currentFormState, int newFormState)
Parameters
System.Int32 currentFormState

The old window state of the form.

System.Int32 newFormState

The new window state of the form

PaintElement(IGraphics, Rectangle, VisualElement)

Paints an element on a specified graphics.

Declaration
protected virtual void PaintElement(IGraphics graphics, Rectangle clipRectangle, VisualElement element)
Parameters
IGraphics graphics

The Graphics object to paint on.

System.Drawing.Rectangle clipRectangle

The clipping rectangle.

VisualElement element

The element to paint.

RefreshNC()

Immediately refreshes the whole non-client area of the form which this behavior is associated with.

Declaration
protected virtual void RefreshNC()

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.