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

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

Definition

Constructors

Creates an instance of the ThemedFormBehavior class.

C#
public ThemedFormBehavior()

Creates an instance of the RadFormBehavior class.

C#
public ThemedFormBehavior(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 ThemedFormBehavior(IComponentTreeHandler treeHandler)
Parameters:treeHandlerIComponentTreeHandler

An IComponentTreeHandler instance.

Properties

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

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

This rectangle represents the bottom border frame of a window.

C#
public virtual Rectangle BottomBorderFrame { get; }

This rectangle represents the bottomleft sizing corner of a window.

C#
public virtual Rectangle BottomLeftResizeFrame { get; }

This rectangle represents the bottom sizing frame of a window.

C#
public virtual Rectangle BottomResizeFrame { get; }

This rectangle represents the bottomright sizing corner of a window.

C#
public virtual Rectangle BottomRightResizeFrame { get; }

This rectangle represents the caption frame of a window.

C#
public virtual Rectangle CaptionFrame { get; }

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

C#
public abstract Rectangle CaptionTextBounds { get; }

This rectangle represents the client rectangle of a window.

C#
public virtual Rectangle ClientFrame { get; }

Gets the current form CreateParams settings.

C#
public virtual CreateParams CurrentFormParams { get; }

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

C#
protected int CurrentFormState { get; }

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.

C#
public RadFormControlBase Form { get; set; }

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

C#
protected MdiClient FormMdiClient { get; }

Gets the rectangle that contains the form's icon.

C#
public abstract Rectangle IconBounds { get; }

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

C#
protected virtual bool IsMaximized { get; }

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

C#
protected virtual bool IsMdiChildMaximized { get; }

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

C#
protected bool IsMenuInForm { get; }

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

C#
protected virtual bool IsMinimized { get; }

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

C#
protected virtual bool IsNormal { get; }

This rectangle represents the left border frame of a window.

C#
public virtual Rectangle LeftBorderFrame { get; }

This rectangle represents the left sizing frame of a window.

C#
public virtual Rectangle LeftResizeFrame { get; }
C#
protected RadMenu MainMenuInForm { get; }

Gets the maximized MDI child if any.

C#
protected Form MaximizedMDIChild { get; }

Gets the rectangle that contains the menu of the form.

C#
public abstract Rectangle MenuBounds { get; }

This rectangle represents the right border frame of a window.

C#
public virtual Rectangle RightBorderFrame { get; }

This rectangle represents the right sizing frame of a window.

C#
public virtual Rectangle RightResizeFrame { get; }

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

C#
public abstract Rectangle SystemButtonsBounds { get; }

This rectangle represents the topleft sizing corner of a window.

C#
public virtual Rectangle TopLeftResizeFrame { get; }

This rectangle represents the top sizing frame of a window.

C#
public virtual Rectangle TopResizeFrame { get; }

This rectangle represents the topright sizing corner of a window.

C#
public virtual Rectangle TopRightResizeFrame { get; }

Methods

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

CreateParams

Overrides: FormControlBehavior.CreateParams(CreateParams)

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

Overrides: FormControlBehavior.Dispose(bool)

This method transforms screen coordinates into local coordinates.

C#
protected virtual Point GetMappedWindowPoint(Point screenPoint)
Parameters:screenPointPoint

The screen point to transform.

Returns:

Point

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

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

C#
protected int GetMaximumFormHeightAccordingToCurrentScreen()
Returns:

int

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

bool

Overrides: FormControlBehavior.HandleWndProc(ref Message)

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

Overrides: FormControlBehavior.InvalidateElement(RadElement, Rectangle)

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

C#
protected virtual void InvalidateNC(Rectangle bounds)
Parameters:boundsRectangle
C#
protected virtual void OnActiveMDIChildTextChanged()

Occurs when a form is associated with the behavior.

C#
protected override void OnFormAssociated()

Overrides: FormControlBehavior.OnFormAssociated()

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

C#
protected virtual void OnGetMinMaxInfo(MinMaxInfo minMaxInfo)
Parameters:minMaxInfoMinMaxInfo

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

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

C#
protected virtual void OnNCPaint(Graphics graphics)
Parameters:graphicsGraphics

The NC Graphics.

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

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

The old window state of the form.

newFormStateint

The new window state of the form

Paints an element on a specified graphics.

C#
protected virtual void PaintElement(IGraphics graphics, Rectangle clipRectangle, VisualElement element)
Parameters:graphicsIGraphics

The Graphics object to paint on.

clipRectangleRectangle

The clipping rectangle.

elementVisualElement

The element to paint.

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

C#
protected virtual void RefreshNC()